ahk icon indicating copy to clipboard operation
ahk copied to clipboard

set input delay...

Open Apprisco opened this issue 1 year ago • 5 comments

Checked the documentation

describe your feature request

Hi, it is completely unclear whether or not you can setup input delay. Right now it types a text message in mere milliseconds, but i want to put a key delay after each stroke for 10ms. This isn't supported right now it seems, while it's a basic feature in AHK.

Apprisco avatar Aug 13 '24 04:08 Apprisco

Have you tried using the key_delay parameter?

spyoungtech avatar Aug 13 '24 10:08 spyoungtech

where? Key_delay exists for just typing, but not sending messages TO a window.

Apprisco avatar Aug 15 '24 20:08 Apprisco

That's true. There is an oversight in the API for Window.send and this parameter isn't there. Though, you did not mention your use case is for sending to a window until just now :)

I should be able to add this feature quickly, both for a key_delay parameter in Window.send and also a global set_key_delay perhaps.

In the meantime, a workaround may be to control the delays 'manually':

delay = 0.1
for key in 'my message':
    win.send(key)
    time.sleep(delay)

spyoungtech avatar Aug 16 '24 19:08 spyoungtech

This is great! By the way, is this send basically ControlSend? Would it cause the same issues as win,shift,alt,ctrl keys being stuck?

Apprisco avatar Aug 17 '24 19:08 Apprisco

Right. The underlying functionality of Window.send uses AutoHotkey's ControlSend, so the behavior you observe will be identical to that of ControlSend in AutoHotkey scripts.

spyoungtech avatar Aug 17 '24 19:08 spyoungtech