What's the script that activates the caps lock like you'd press it on the keyboard?
Real Pressing Caps Lock
sendInput {CapsLock}
OS: Windows 7 Ultimate / Windows 8.1 Pro | Editor: Notepad++
sendInput {CapsLock}
Okay nice, could you change the script that put the caps lock automatically off once the next key (next key after caps) has been pressed? Something simliar like this (not working caps lock):
#NoEnv
#Persistent
SetKeyDelay, -1
x := True ; start off script with an assumed capital (true)
Loop
{ Input, key, C I L1 V
TOOLTIP % X GetKeyState("CapsLock",T)
if( x && RegExMatch(key,"[a-z]") && !GetKeyState("CapsLock","T"))
{
SetCapsLockState, On
Send {Backspace}+%key%
}
else if (x && GetKeyState("CapsLock","T"))
{
SetCapsLockState, Off
If RegExMatch(key,"[A-Z]")
Send % "{Backspace}" Chr(Asc(key)+32)
x:= False
}
else if InStr(".?!", key)
x := True
}
What's not working about it? I replaced both SetCapsLockState commands with SendInput.
#NoEnv #Persistent SetKeyDelay, -1 x := True ; start off script with an assumed capital (true) Loop { Input, key, C I L1 V TOOLTIP % X GetKeyState("CapsLock",T) if( x && RegExMatch(key,"[a-z]") && !GetKeyState("CapsLock","T")) { sendInput {CapsLock} Send {Backspace}+%key% } else if (x && GetKeyState("CapsLock","T")) { sendInput {CapsLock} If RegExMatch(key,"[A-Z]") Send % "{Backspace}" Chr(Asc(key)+32) x:= False } else if InStr(".?!", key) x := True }
OS: Windows 7 Ultimate / Windows 8.1 Pro | Editor: Notepad++
What's not working about it? I replaced both SetCapsLockState commands with SendInput.
#NoEnv #Persistent SetKeyDelay, -1 x := True ; start off script with an assumed capital (true) Loop { Input, key, C I L1 V TOOLTIP % X GetKeyState("CapsLock",T) if( x && RegExMatch(key,"[a-z]") && !GetKeyState("CapsLock","T")) { sendInput {CapsLock} Send {Backspace}+%key% } else if (x && GetKeyState("CapsLock","T")) { sendInput {CapsLock} If RegExMatch(key,"[A-Z]") Send % "{Backspace}" Chr(Asc(key)+32) x:= False } else if InStr(".?!", key) x := True }
Well, the caps lock doesn't go away after it has been used already.