How to cancel key sending sequence when key is up
Posted: 21 Apr 2021, 15:32
Hello im new to the ahk. Im trying to make my script keep sending the sequence when key is down but cancel it when key is up and send it over again once i press the key.
I tried googling a few times for a solution but didnt found anything that works.
[Mod edit: [code][/code] tags added.]
I tried googling a few times for a solution but didnt found anything that works.
Code: Select all
a::
if GetKeyState("a", "P){
Send 5
Random, VariableDelay, 10, 20
Sleep, %VariableDelay%
Send r
Random, VariableDelay, 132, 132
Sleep, %VariableDelay%
Send {t down}
Random, VariableDelay, 225, 225
Sleep, %VariableDelay%
Send {t up}
Send {q down}
Random, VariableDelay, 5000, 5000
Sleep, %VariableDelay%
Send {q up}
}
return
a UP::
Exit
return