Skip to content

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

Closed
@suchipi

Description

@suchipi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions