Here is an example from docs:
Code: Select all
~CapsLock::
KeyWait, CapsLock ; Wait for user to physically release it.
MsgBox You pressed and released the CapsLock key.
return
Code: Select all
; Press CapsLock and you will see message box, despite of "KeyWait, z"
~CapsLock::
KeyWait, z
MsgBox You pressed and released the CapsLock key.
return
Code: Select all
keyWait, rButton, d
keyWait, rButton
soundBeep, 300, 300
return
So, is my example is really correct and example in docs isn't correct?camerb (moderator) wrote:Yeah, I've heard of this mistake being made before... perhaps the docs need to have a note in there about how it waits for the key to be in the up state, rather than an up action.
Source: https://autohotkey.com/board/topic/6648 ... /?p=420580
And also, how I could change my example in this way? :
Code: Select all
; Doesn't correctly work: at first mouse click there is only short beep
rButton::
soundBeep, 300, 300
keyWait, rButton, d
keyWait, rButton
soundBeep, 300, 1000
return