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

Document behavior of key events interacting with window focus #3575

Open
SpecificProtagonist opened this issue Mar 8, 2024 · 1 comment
Open
Labels
S - docs Awareness, docs, examples, etc.

Comments

@SpecificProtagonist
Copy link

What happens when a key is held while a window loses focus? E.g. on X11 a synthetic key up event is received while on MacOS a key up event is received when the user releases the key. The behavior also seems to differ between modifier and normal keys.

Winit should document how window focus influences what key events get send and how this differs between platforms.

See also #3543

@kchibisov
Copy link
Member

The general rule of thumb is assume that everything is lifted upon a lose of focus and on re-enter you should never reprocess anything.

I'm not so sure if winit should explicitly document emit releases other than making people assume that everything is lifted though. Or at least it should do that in the way that doesn't bleed into regular input processing.

I'm pretty sure that modifiers are documented and behave more or less consistently. The modifiers are assumed empty when the focus is left, though it might get adjusted in the future a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S - docs Awareness, docs, examples, etc.
Development

No branches or pull requests

2 participants