i have been struggling to make a script that holds down the letter e for about 3 seconds then lets it go for 3 seconds and then does it again on repeat forever until i press F5 (i would also like F5 to start and stop it please)
thank you for reading this i would be very thankful if you could do this for me also one of the main reason for this is because i am not used to ahk v2
trying to make a script that holds down then lets go the key
Re: trying to make a script that holds down then lets go the key
Welcome to this AutoHotkey forum!
Code: Select all
#Requires AutoHotkey v2.0
F5:: {
Static on := False
If on ^= True {
SetTimer(toggleState, 3000), toggleState()
SoundBeep 1500
} Else {
SetTimer toggleState, 0
If GetKeyState('e')
toggleState
SoundBeep(1000), Sleep(400), ToolTip()
}
}
toggleState() {
Send GetKeyState('e') ? '{e up}' : '{e down}'
ToolTip GetKeyState('e')
}
Who is online
Users browsing this forum: No registered users and 3 guests