1
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
Your question is difficult to understand. What do you mean by
[ Combo Break ]
? How should AHK respond if you intend to press Q three times, but pause after the first keypress (should it senda
)? – I say Reinstate Monica – 2017-09-22T20:30:42.5971Excuse me. This was really confusing. Let me try to explain:
Every time I press Q, a letter in the loop is sent. Example: pressing Q, Q, Q, Q, Q, Q, Q, Q = sends "a", "b", "c", "d", "a", "b", "c", "d".
What I needed was a way to reset the loop if I did not press Q for a while. Example: pressing Q, Q, Q, (so do not press Q for few seconds), and then Q again = "a", "b", "c", (after idle), "a" again (not "d"). The loop restarted after idle. – rdllngr – 2017-09-22T21:04:15.170
That makes a lot more sense! Please consider editing your question so that others can benefit from the answer you found. – I say Reinstate Monica – 2017-09-22T21:51:19.117
With pleasure. Thanks for the instruction. :) – rdllngr – 2017-09-22T23:02:58.777