I use an application everyday which listens out for double clicks of the control key. It also keymaps another function to a single click of the control key, and there is no way within the application to prevent or remap one or other function.
What I'd like to do is use AutoHotkey to prevent the application from responding to the double control click.
The application won't respond with the default double click behaviour if a mouse move is inserted between the two control keydown events.
Is there any way I can write an AutoHotkey script to listen for two sequential clicks of the control key, and insert a benign event (e.g. a mouse event) before the second control click?
I've tried the following code, but the second LControl is still getting through. Is there anyway to prevent the second LControl from getting through?
~LControl::
if (A_PriorHotkey <> "~LControl" or A_TimeSincePriorHotkey > 400)
{
; Too much time between presses, so this isn't a double-press.
SendInput {LControl}
return
}
MouseMove 5,5,10,R
;SendInput {LControl}
return
~
will always trigger a key's native function, that is, aCTRL
keypress will trickle through by definition! Remove the modifier,LControl::
should do fine. – MCL