6

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)

0

2 Answers 2

6

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.

0
5

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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.