![](https://secure.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?s=100&d=%2F%2Fwww.autohotkey.com%2Fboard%2Fpublic%2Fstyle_images%2Fortem%2Fprofile%2Fdefault_large.png)
How press a key
![How press a key: post #1](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
send {w down}
to hold the key. Note that it might not work in a game (see gaming forum), and it's not the same as holding w on a real keyboard (no auto repeat)More details under 'send' in the help file
![How press a key: post #2](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
![How press a key: post #3](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
x:: Suspend, On while (GetKeyState("x", "p")) { send, {w down} sleep, 100 } send, {w up} Suspend, Off returnBut, in the end, everything depends on the game, and the way the developers programmed it, as to the extent that you can automate the game's actions.
![How press a key: post #4](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ●
MMO Fighter KeyLooperDemo Key Spammer TinyClickRecorder GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.
![How press a key: post #5](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
![How press a key: post #6](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ●
MMO Fighter KeyLooperDemo Key Spammer TinyClickRecorder GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.
; press and release x to start the key send ; press and release x again to stop the send x:: keywait x, D Keywait x xflag := !xFlag if (xflag) { loop { Tooltip, press x to stop sending... send, {w} sleep, 50 If (!xflag) break } } send, {w up} tooltip return
![How press a key: post #8](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ●
MMO Fighter KeyLooperDemo Key Spammer TinyClickRecorder GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.
The first one would work if you remove both
Suspend
lines.The second one would work if you add
#MaxThreadsPerHotkey 2
at the top.
![How press a key: post #9](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
To hold down or release a key: Enclose in braces the name of the key followed by the word Down or Up. For example:
Send {b down}{b up}
Send {TAB down}{TAB up}
Send {Up down} ; Press down the up-arrow key.
Sleep 1000 ; Keep it down for one second.
Send {Up up} ; Release the up-arrow key.
When a key is held down via the method above, it does not begin auto-repeating like it would if you were physically holding it down (this is because auto-repeat is a driver/hardware feature). However, a Loop can be used to simulate auto-repeat. The following example sends 20 tab keystrokes:
Loop 20
{
Send {Tab down} ; Auto-repeat consists of consecutive down-events (with no up-events).
Sleep 30 ; The number of milliseconds between keystrokes (or use SetKeyDelay).
}
Send {Tab up} ; Release the key.
The word DownTemp may also be used. Its effect is the same as Down except for the modifer keys (Control/Shift/Alt/Win). In those cases, DownTemp tells subsequent sends that the key is not permanently down, and may be released whenever a keystroke calls for it. For example, Send {Control DownTemp} followed later by Send a would produce a normal "a" keystroke, not a control-A keystroke.
![How press a key: post #10](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ●
MMO Fighter KeyLooperDemo Key Spammer TinyClickRecorder GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.
![How press a key: post #11](http://www.autohotkey.com/board/public/style_images/ortem/icon_share.png)
The universe is a wondrous place! The faster you create unbreakable code, the faster the universe creates people that can break it. All scripting follows the rule Rule Of Twos -- 1) Good, 2) Fast 3) Cheap -- pick any Two.
I guarantee absolutely nothing about any code I provide except that it works in my machine. ●
MMO Fighter KeyLooperDemo Key Spammer TinyClickRecorder GGs Password Generator.ahk
For the newest version of AutoHotkey and some killer scripts go here.