Thanks, but is there any way to do this while leaving my other hotkeys clean? All of the down events are in KeyHistory, so if I could even somehow grab the first down event for the key when it's released, it would be easy.
I guess this is fairly trivial for keys that don't naturally output anything.
So I guess I could do capslock with:
Code: Select all
~capslock::
KeyWait, CapsLock
If (A_PriorKey = "CapsLock" and A_TimeSinceThisHotkey < 400)
Send, {Esc}
But that won't work for keys that send output, as ~enter would let the enter key through.
And it wouldn't help to assign a global variable inside one of my other hotkeys, because if they're called, Enter wont need to be called.
I guess I could set a variable tracking enter's state, start a timer there, have it fire its normal functions on key up if the conditions pass, and then setting a section of conditional hotkeys that are only active if enter is down.
But that seems kind of hacky, and I worry that having that many conditional hotkeys might be unreliable. But maybe I'm worrying about nothing.