Skip to content

wayland: match keybinds on every shift level of a key - #2228

Merged
flightlessmango merged 1 commit into
flightlessmango:masterfrom
JROtto5:fix/2039-wayland-keysym-level
Nov 23, 2026
Merged

flightlessmango merged 1 commit into
flightlessmango:masterfrom
JROtto5:fix/2039-wayland-keysym-level

Conversation

@JROtto5

@JROtto5 JROtto5 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #2039.

On Wayland, a binding like toggle_hud=Shift_L+6 never fires. The key listener stored the keysym for the current modifiers, so with Shift held the 6 key was recorded as asciicircum (ampersand on some layouts), and releasing Shift first left that keysym stuck. Pressed keys now keep their keysyms at every level, per keycode, so either name matches, as it already does on X.

Tested with native Wayland vkcube in a nested headless KWin, keys sent through its EIS input: toggle_logging=Shift_L+6 toggles logging on this branch in 3/3 runs, on master in 0/3, and Shift_L+asciicircum still works but no longer fires again on Shift alone.

The pressed-key set stored the keysym for the current modifier state, so
with Shift held "6" was recorded as "asciicircum" (or "ampersand" on
other layouts) and toggle_hud=Shift_L+6 never fired. Releasing Shift
before the key also erased a different keysym than the press added,
leaving the shifted one stuck.

Record each pressed key's keysyms at all levels, keyed by keycode, and
drop that entry on release. X already accepts either name because it
compares bindings by keycode.

Fixes flightlessmango#2039
@flightlessmango
flightlessmango merged commit aea892f into flightlessmango:master Nov 23, 2026
2 checks passed
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.

Keybind toggle_hud=Shift_L+6 does not work under wayland but x11

2 participants