I have a code that every time I press the hotkey, a letter is sent.
Pressing Q, Q, Q, Q, Q is sent "a", "b", "c", "d", "e", respectively. Then the loop restarts.
For example: pressing Q 13 times sends "abcdeabcdeabc".
My question is:
How can I reset the loop and return to the first letter ("a") if I do not press Q for a few seconds?
My code:
q::
Send, % ["a","b","c","d","e"][(count >= 5 || !count)? count := 1 : ++count]
return
[ Combo Break ]
? How should AHK respond if you intend to press Q three times, but pause after the first keypress (should it senda
)?