Skip to content

feat(input): add pre-compiled keymap#1907

Closed
my4ng wants to merge 1 commit intoSmithay:masterfrom
my4ng:keymap
Closed

feat(input): add pre-compiled keymap#1907
my4ng wants to merge 1 commit intoSmithay:masterfrom
my4ng:keymap

Conversation

@my4ng
Copy link
Copy Markdown

@my4ng my4ng commented Jan 18, 2026

This allows setting a pre-compiled keymap while ensuring the keymap was created under the same keyboard handle, and more importantly, the same xkbcommon context within the same thread.

This is related to stefanboca/niri#1 which adds per-device keyboard layout. To support this, if the keymap of a keyboard is different from that of the last used one, then we need to set the new keymap. Currently, the only methods to achieve this are set_keymap_from_string and set_xkb_config, which both require compiling the keymap every time on switching. The new get_keymap and set_keymap methods thus allow caching the compiled keymaps, likely in a HashMap, to prevent redundant keymap compilations.

This allows setting a pre-compiled keymap while ensuring the keymap
was created under the same keyboard handle, and more importantly, the
same xkbcommon context within the same thread.
@Bot-wxt1221
Copy link
Copy Markdown
Contributor

I believe this will help on #1903

@my4ng
Copy link
Copy Markdown
Author

my4ng commented Feb 4, 2026

Superseded by #1903

@my4ng my4ng closed this Feb 4, 2026
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.

2 participants