Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set input delay... #335

Open
1 task done
Apprisco opened this issue Aug 13, 2024 · 5 comments
Open
1 task done

set input delay... #335

Apprisco opened this issue Aug 13, 2024 · 5 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@Apprisco
Copy link

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.

@spyoungtech
Copy link
Owner

Have you tried using the key_delay parameter?

@spyoungtech spyoungtech added the question Further information is requested label Aug 14, 2024
@Apprisco
Copy link
Author

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

@spyoungtech
Copy link
Owner

spyoungtech commented Aug 16, 2024

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 spyoungtech added the enhancement New feature or request label Aug 16, 2024
@Apprisco
Copy link
Author

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?

@spyoungtech
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants