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

Linux and Windows keypress functions microsleep between each key, but macOS doesn't #101

Closed
suchipi opened this issue Jan 27, 2022 · 2 comments · Fixed by #108
Closed

Linux and Windows keypress functions microsleep between each key, but macOS doesn't #101

suchipi opened this issue Jan 27, 2022 · 2 comments · Fixed by #108

Comments

@suchipi
Copy link

suchipi commented Jan 27, 2022

Version

develop branch (f8dd1b7 on date issue was opened)

Short overview

Windows and Linux have a hard-coded microsleep associated with each keypress, but macOS doesn't. This makes it difficult to type really fast on Windows/Linux.

Could I open a PR removing the sleeps from Windows/Linux?

Detailed error description

See here on windows, where WIN32_KEY_EVENT_WAIT is used when win32KeyEvent would suffice:

https://github.com/nut-tree/libnut/blob/f8dd1b75ce84cab6d02e34319717f876c29d1d3b/src/win32/keypress.c#L69-L81

And here, on Linux, where X_KEY_EVENT_WAIT is used when X_KEY_EVENT would suffice:

https://github.com/nut-tree/libnut/blob/f8dd1b75ce84cab6d02e34319717f876c29d1d3b/src/linux/keypress.c#L28-L40

but here, on macOS, waits are only introduced when calling typeStringDelayed:

https://github.com/nut-tree/libnut/blob/f8dd1b75ce84cab6d02e34319717f876c29d1d3b/src/macos/keypress.c#L51-L58

@s1hofmann
Copy link
Member

Hi @suchipi 👋

Feel free to open a PR and I'll have a look 👍

@suchipi
Copy link
Author

suchipi commented Mar 13, 2022

Sorry I never got around to this, and thank you for fixing it ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants