How to interrupt alternate keys for same hotkey? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
rdllngr
Posts: 54
Joined: 22 Sep 2017, 09:39

How to interrupt alternate keys for same hotkey?

22 Sep 2017, 09:45

My code function:

If you press Q once, send "a".
If you press Q twice, send "b".
If you press Q three times, send "c".
If you press Q four times, send "d".

But, I need this way:

If you press once, send "a".
If you press twice, send "b"...

[ Combo Break ] (I need that stop if...)

— If you press other key than Q;
— If you take too long to press any key (Q included);

...reset and return to time 1...

Then...

If you press once, send "a".



My code:

Code: Select all

q::
Send, % ["a","b","c","d"][(count >= 4 || !count)? count := 1 : ++count]
return
rdllngr
Posts: 54
Joined: 22 Sep 2017, 09:39

Re: How to interrupt alternate keys for same hotkey?  Topic is solved

22 Sep 2017, 15:17

I found a solution by myself. I hope this can help someone in the future.

Good luck. :dance:

Code: Select all

q::
Send, % ["a","b","c","d"][A_TimeSincePriorHotkey>2500 || A_PriorHotkey<>A_ThisHotkey || (count >= 4 || !count) ? count := 1 : ++count]
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 277 guests