Add XkbContext::update_mask
and XkbContext::set_update_key
#1597
+44
−22
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.
For a nested compositor, it's useful to be able to pass through the modifiers state from the parent compositor unchanged.
set_mask
provides a way to do that. Meanwhileset_update_key()
provides a way to disable the current calls toxkb_context_updatE_key
.Alternately to
set_update_key()
, a boolean argument could be added to bothinput()
andinput_intercept()
. Not sure which is better. Either is a bit ugly.update_mask
uses seperate arguments for depressed/latched/locked instead ofSerializedMods
, sinceeffective
isn't applicable here. It usesu32
for those, likeSerializedMods
, butLayout
for the layout since it exists. Xkbcommon has a separate depressed/latched/locked layout, but we only use one since that's what theset_layout
function andwl_keyboard::modifiers
already assumes. (I guess X11 differentiated these, but depressed/latched didn't end up being used in practice?)This could also be used on the X11 backend. I'm not sure if winit exposes the necessary information to call
set_mask
.