Skip to content

Keyboard methods pressKey and releaseKey ignore updated autoDelayMs #188

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

Closed
dancesWithBugs opened this issue Dec 3, 2020 · 2 comments
Closed
Labels
enhancement Enhancement to existing features
Milestone

Comments

@dancesWithBugs
Copy link
Contributor

Version

1.5.0

Description

One can update the keyboard's auto-delay value by setting keyboard.config.autoDelayMs to a new value. The type() method will then use the updated value, but pressKey() and releaseKey() will not. For these, the delay has to be updated via keyboard.nativeAdapter.keyboard.setKeyboardDelay().

This is inconsistent behavior and should be streamlined. I'd suggest updating Keyboard to add a setter that updates the delay in a streamlined fashion for all methods.

@s1hofmann
Copy link
Member

Closed by #384

@eun-ice
Copy link

eun-ice commented May 9, 2022

This change causes undesirable behaviour in all our use-cases.

One Use-Case is that we register a global shortcut (say ctrl-alt-shift-s) in our app that sends Ctrl-C to the OS to copy whatever is currently selected on any open App and then reads the value from Clipboard.

To do that we have to release all other modifier keys. If we send one releaseKeys with all Modifierkeys except Ctrl we get an error. So we send releaseKey for each modifier Key. The timeout introduced in this commit increases the delay way too much for us.

The other Use-Case is remote controlling the system, having a timeout in releaseKey and pressKey is just slowing down everything.

I don't think it is ever useful to have a delay in releaseKey and even in pressKey I dont see why there ever should be one?

With type the timeout makes total sense.

At least this should be considered a breaking change.

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

No branches or pull requests

3 participants