(script just press e and hold it)
Code: Select all
^5::
Loop
Send, {e down}
Sleep, 5000
Send, {e up}
Sleep, 10000
Return
^6::
ExitApp
Return
Code: Select all
^5::
Loop
Send, {e down}
Sleep, 5000
Send, {e up}
Sleep, 10000
Return
^6::
ExitApp
Return
Code: Select all
#Requires AutoHotkey 1
Send {e down}
Sleep 500
Send {e up}
SoundBeep 1500
If you are new to AHK, I recommend using its current version, which is v2, instead of this older deprecated version that is no longer developed.The loop statement is usually followed by a block, which is a collection of statements that form the body of the loop. However, a loop with only a single statement does not require a block (an "if" and its "else" count as a single statement for this purpose).
Source: Loop - Syntax & Usage | AutoHotkey v1
Mikey, when the topic is AHK, I am inclined to trust you more than my eyes.{... down} and {... up} can be used with any key.
You are correct, but that is not specifically what the OP originally asked for. Please see Repeating or Holding Down a Key.cevvalkoala wrote: I don't get an "eeeeeeeeeeeeeeeeeeeeeeeeee", but just a single e.
it appears that you are missing your brackets for the loop, so the code you posted will only run the first line after the loop endlessly so in essence you are just pressing e down and never releasing it.
Code: Select all
^5::
Loop
{ ;Note: brackets are needed here otherwise the loop will do nothing but send the first line over and over
Send, {e down}
Sleep, 5000
Send, {e up}
Sleep, 10000
} ;closing bracket
Return
^6::
ExitApp
Return