What I want to do is create a script that allows me to disable the effect of the PgDn or PgDn keys while it waits (so it doesn't instantaneously capture the hotkey so there's no override), while not having any effect on the program in that wait duration.
Example scenario: In the 3 seconds that the PgDn key must be held down to activate a (say) MsgBox, it must not cause a browser window, etc. To accept the PgDn input. That is I don't want my webpage scrolling down while I'm pressing down the PgDn key.
This is my code so far.
~PgDn:: If PgDnIsPressed return PgDnIsPressed := true SetTimer, WaitForRelease, 3000 return ~PgDn Up:: SetTimer, WaitForRelease, Off PgDnIsPressed := false return WaitForRelease: SetTimer, WaitForRelease, Off msgbox Working return
It works, but not without scrolling the webpage in any way.
EDIT: I also ran the following registry script to disable the action of the PgDn and PgUp keys:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout] "Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,00,00,49,e0,00,00,51,e0,00,00,00,00
But now it seems like AHK too won't accept PgDn and PgUp keys, even if Windows won't.
The idea is to only let AHK get the input.