How to use GetKeyState to "batch" key combination code?
Posted: 19 Sep 2016, 13:44
I found code on the forum to do the following... and it works.
I'd like to do the same with the Control key and thought this would work but it doesn't.
What am I missing? Thanks!
Code: Select all
CapsLock::
KeyWait, CapsLock
If (A_PriorKey="CapsLock")
SetCapsLockState, % GetKeyState("CapsLock","T") ? "Off" : "On"
return
#If GetKeyState("CapsLock", "P")
a:: MsgBox % "You pressed CapLock + a"
b:: MsgBox % "You pressed CapLock + b"
#If
Code: Select all
Control::
KeyWait, Control
return
#If GetKeyState("Control", "P")
a:: MsgBox % "You pressed Control + a"
b:: MsgBox % "You pressed Control + b"
#If