ahk.type key delay
Checked the documentation
- [X] I have checked the documentation for the feature I am requesting
describe your feature request
I want AHK to type (not send) emails and passwords for example into a window. Trying to set the key_delay for this isn't working: ahk.type(account.email,key_delay=50)
Obviously I can replicate this with a for loop typing a single key at a time, but that seems wasteful lol.
If you're using AutoHotkey v2, you'll have to change the send mode in order to see the effect of the key_delay parameter take place properly. Keep in mind, AutoHotkey v2 uses Input as its default SendMode. As noted in the SetKeyDelay documentation, key delay has no effect when the SendMode is Input.
Try the following, which sets the send mode to Event, which will allow the key delay to take effect:
from ahk import AHK
ahk = AHK(version='v2')
ahk.send('anything', key_delay=50, send_mode='Event')
# OR
ahk.set_send_mode('Event')
ahk.send('anything', key_delay=50)
When using AutoHotkey v1, this isn't necessary since Event is the default send mode in v1.
Using key delay with .type is, incidentally, not currently supported because it uses SendInput as its implementation (and, as discussed, Input send mode does not support this).
If you're using AutoHotkey v2, you'll have to change the send mode in order to see the effect of the
key_delayparameter take place properly. Keep in mind, AutoHotkey v2 usesInputas its default SendMode. As noted in the SetKeyDelay documentation, key delay has no effect when the SendMode isInput.Try the following, which sets the send mode to
Event, which will allow the key delay to take effect:from ahk import AHK ahk = AHK(version='v2') ahk.send('anything', key_delay=50, send_mode='Event') # OR ahk.set_send_mode('Event') ahk.send('anything', key_delay=50)When using AutoHotkey v1, this isn't necessary since
Eventis the default send mode in v1.Using key delay with
.typeis, incidentally, not currently supported because it usesSendInputas its implementation (and, as discussed,Inputsend mode does not support this).
Hi! Is it possible to send input immediately to certain window? I'm using window.send it's like typing, but I would like to do it as fast as possible