Retrigger script if trigger key pressed again Topic is solved

Ask gaming related questions (AHK v1.1 and older)
Mementoe
Posts: 3
Joined: 17 Apr 2024, 19:53

Retrigger script if trigger key pressed again

Post by Mementoe » 29 Apr 2024, 02:39

Hello,
I am looking for help writting a script which whenever e is pressed, m will be held down for 1 second. Additionally, I would like to be able to retrigger this action before the 1 second duration has expired by repressing e. Hence the m key would be released and then repressed down for 1 second everytime e is pressed. Any help would be greatly appreciated.
Rohwedder
Posts: 7895
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Retrigger script if trigger key pressed again  Topic is solved

Post by Rohwedder » 29 Apr 2024, 05:35

Hallo,
try:

Code: Select all

e::
Send, {m Down}
SetTimer, MTimer, -1000
Return
MTimer:
Send, {m Up}
Return
Mementoe
Posts: 3
Joined: 17 Apr 2024, 19:53

Re: Retrigger script if trigger key pressed again

Post by Mementoe » 29 Apr 2024, 18:02

Thank you, works like a charm.
Post Reply

Return to “Gaming Help (v1)”