Skip to content

Conversation

axelkar
Copy link

@axelkar axelkar commented Jul 24, 2025

Fixes #1018

@axelkar
Copy link
Author

axelkar commented Jul 24, 2025

This is important for keysym input emulation where xkbcommon just gives us possible modifier masks and keycodes.

https://github.com/rust-x-bindings/xkbcommon-rs/blob/cb449998d8a3de375d492fb7ec015b2925f38ddb/examples/how-to-type.rs#L120-L146

The keyboard middleware should probably be structured a little differently. It's all in one giant file, and ModifiersState can contain duplicate and outdated information. The serialized field and the other fields in ModifiersState aren't guaranteed to be updated in sync.

It's also not immediately obvious, as a consumer, where the data moves and what structs I can access. (KeyboardHandle, KeyboardInnerHandle, KeybordGrab, KeyboardTarget).

It's also not immediately obvious that I should modify the modifier state with KeyboardHandle::set_modifier_state rather than KeyboardHandle::with_xkb_state and xkb::State::update_mask to get integration with the "high-level/lossy modifier state" as I've been calling it.

@axelkar axelkar force-pushed the advertise-modifier-state branch from dc15dcd to 7496bb1 Compare July 24, 2025 17:52
@axelkar axelkar changed the title Advertise new state in KeyboardHandle::set_modifier_state Add KeyboardHandle::advertise_modifier_state Jul 24, 2025
@axelkar
Copy link
Author

axelkar commented Oct 9, 2025

Rebased on master

@axelkar axelkar force-pushed the advertise-modifier-state branch from 7496bb1 to baafa19 Compare October 9, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible typo in the documentation of the struct KeyboardHandle

1 participant