Snowcap/Layer: improve key event handling #383
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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