-
-
Notifications
You must be signed in to change notification settings - Fork 24
Snowcap/Layer: improve key event handling #383
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
Conversation
1d9f273 to
ad0c3dc
Compare
89f398b to
40d902a
Compare
40d902a to
db3bb93
Compare
db3bb93 to
927de0c
Compare
927de0c to
31088e5
Compare
Ottatop
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if the function should be marked as deprecated, or kept as a short-hand if only key press are needed.
Let's keep it as shorthand for now. Outside of the comments, lgtm.
31088e5 to
f15b1f8
Compare
The on_key_pressed handler can be limiting since: - it doesn't allow to react to key being released - it doesn't transmit the processed `text` associated with keys when using a layout with dead keys. - it doesn't transmit captured events (I've added this one to conserve the previous behavior.) This commit address this by adding a on_key_event that transmit the key state, whether it was captured on the server side, and the associated text if available.
The on_key_pressed handler can be limiting since: - it doesn't allow to react to key being released - it doesn't transmit the processed `text` associated with keys when using a layout with dead keys. - it doesn't transmit captured events (I've added this one to conserve the previous behavior.) This commit address this by adding a on_key_event that transmit the key state, whether it was captured on the server side, and the associated text if available.
f15b1f8 to
7b25a72
Compare
Ottatop
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This PR address a few issue I have with the current
Layer::on_key_pressedon_releaseevents (mentioned in [Request] Input Grabbing API #328).textassociated with the event (mentioned in [Request] Input Grabbing API #328).I've cherry-picked some commits from #369 (the one to emit the
textin events).To avoid breaking current config,
Layer::on_key_pressedwas mostly kept as-is, except I'm explicitly discarding events if they werecaptured, since they used to be discarded on the server side. I don't know if the function should be marked as deprecated, or kept as a short-hand if only key press are needed.I did not add
Layer::on_key_release, since:Layer::on_key_event()function.closes #374