How do I delay Send
commands in AutoHotkey?
If AutoHotkey sends the keypresses faster than a program can register the inputs, words can end up mistyped with missing letters. (stuff
ends up like stf
, or wasd squad
ends up like wsdsqad
)
SetKeyDelay
is what you need.
Note: SetKeyDelay
is not obeyed by SendInput
; there is no delay between keystrokes in that mode. This same is true for Send
when SendMode Input
is in effect.
SetKeyDelay, Delay between keystrokes in milliseconds, PressDuration in milliseconds
Of course this doesn't work with SendInput formats, but it does work with Send and ControlSend commands
So if you wanted a half-second delay between keypresses and each key to be held down for a quarter of a second, it would look like this:
SetKeyDelay, 500, 250
A practical example would be:
SetKeyDelay, 500, 250
Send Sincerely,{enter}John Smith
In this way, there would be a brief pause between keypresses and each key would be pressed a lot more like a real person would, thereby alleviating your probem of autohotkey sending keypresses faster than they can be registered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With