When launching the task manager (which has admin privileges) via capsLock+shift+escape, ahk still thinkgs that capsLock is held down although I release it (can be seen in the loop code which uses get key state)
My question is how can I make AHK get the physical state of a key so that when I launch task manager and release the capslock key the tooltip will write capsPressed=0 (would be nice to also launch the keyup event but this can be done in the loop, and am aware that ctrl is only pressed on the non admin level)
I've tried #InstallKeybdHook, #UseHook and do not work.
I am not interested to launch my script with admin privileges.
Code: Select all
loop {
ctrlState := getKeyState("ctrl")
keyState := getKeyState("2", "P")
display := ""
display := display . "ctrlState=" . ctrlState . "`n"
display := display . "keyPressed=" . keyState . "`n"
tooltip % display
sleep 500
tooltip
}
*2::
send {blind}{ctrl down}
return
*2 up::
send {blind}{ctrl up}
return