Hi,
I've looked extensively for an answer to this question, so please forgive me if it has been posted and I missed it.
I want to use KeyWait, but I do not want the key that is pressed to be sent through to the system. For example I'd like to do the following
F5::
*code*
KeyWait, PGDN, D
*more code:
return
I do not want PGDN to be its own hotkey, because I simply want the code I execute with my F5 hotkey to pause until I continue it by pressing PGDN. But I do not want that PGDN to be sent through to the system, I only want it to be captured by AHK and used to continue the code execution. Afterward, PGDN should function as a normal key.
Is there a way to do this?
I saw previously someone mentioning Pause, On and then unpausing with page down with the below code:
#If A_IsPaused
PGDN::Pause, Off
#If
This produces inconsistent behavior and is not ideal. I really just want to simplicity of KeyWait without sending the keypress. Thanks!
KeyWait without sending key press
Re: KeyWait without sending key press
Cap'n Odin very nicely posted the code below in the discord server which I am copying here in case any one runs into the same problem. Thanks!
***
F5::
ToolTip, waiting
Hotkey, PgDn, label, On
KeyWait, PgDn, D
Hotkey, PgDn, label, Off
ToolTip, done
return
label:
return
***
F5::
ToolTip, waiting
Hotkey, PgDn, label, On
KeyWait, PgDn, D
Hotkey, PgDn, label, Off
ToolTip, done
return
label:
return
Who is online
Users browsing this forum: Bing [Bot], peter_ahk and 339 guests