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

No keydown/keyup for autorepeats; no keypress except for autorepeats #10

Open
mncharity opened this issue Mar 8, 2018 · 0 comments
Open

Comments

@mncharity
Copy link

mncharity commented Mar 8, 2018

InputEvent.Keyboard emits keydown, keyup, and keypress events. This looks like the browser keyboard event api. But it behaves differently.

In browser, a physical depress and release gives a keydown-keypress pair, and then a keyup. A keyboard autorepeat gives just a keydown-keypress pair (it used to give a keyup as well).

EV_KEY is different. Value 1 is physical depress. Value 0 is physical release. Value 2 is autorepeat.

These EV_KEYs are currently emitted as keydown, keyup, and keypress. So you don't get keydown (or keyup) from autorepeats. And you don't get a keypress from any physical key depresses, only from autorepeats.

So while this looks like the browser api, it behaves differently. Which is confusing.

Some possibilities include: (a) document that you don't get keydown for autorepeats, and don't get keypress for physical presses; (b) rename keypress to repeat; (c) rename keyup and keydown to depress and release. (Or to keyrepeat, keydepress, keyrelease?)

Thanks for your work!

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

No branches or pull requests

2 participants