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
Remove synthetic key events? #3543
Comments
I'd rather move them out of normal events, because folks handle them but these events shouldn't trigger general input. |
Synthetic press events: I don't have a use for them. Synthetic release events (i.e. matching a real press): these are useful to notify that a press-and-hold sequence should be terminated. |
Yeah, but you generally should assume that every key is lifted upon focus lost, since that's mostly the only case where it can happen iirc. But yeah, releases make more sense than presses, since people may think that they should input from synthetic presses, while in really it's not the case. |
Sure, I could handle the key-releases on my end. I guess the only real thing is whether keys held while the window does not have focus are handled correctly. I can trick my text editor like this, but it's unimportant: focus another window, press and hold More important might be something like Blender where modifier keys affect what click+drag does. But to handle that correctly the synthetic key press has to arrive before the mouse-click event, and that's still not good enough to handle cursors (in case the modifier key should change the mouse cursor seen on hover). It is also possible to handle this stuff without synthetic key presses; they just make that easier (assuming they do the right thing). |
You shouldn't handle represses when you had something latched upon focus though, the general recommendation to never do so, because it's always not intended. That's the general advice by core wayland protocol as well and the same with x11, I think.
You generally shouldn't replay button presses, because user could use this modifier as a part of e.g.
|
For reference, here is an incomplete list of UI frameworks that mistakenly interpret synthetic key presses as real key presses:
I'm guessing every UI framework will make this mistake, until, after years of subtle customer confusion/annoyance, they realize what is going on and fix the bug on their end. Perhaps it would be best to hide the synthetic key press events by default. |
Raised in #3538 (comment).
Should we remove synthetic keyboard events (those that contain
is_synthetic
)?What are the benefits and the drawbacks?
The text was updated successfully, but these errors were encountered: