keybinds: fix multikey binds breaking after scroll wheel events #12638
+16
−10
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.
Summary
Fixes multikey keybinds (
binds/sflag) becoming unresponsive after using the mouse scroll wheel, until a mouse click is performed. Workarounds useydotoolto generate click events when pressing mod-keys, but this generates click events in undesirable places.Fixes #8699
This bug was introduced in #5966 (multikey keybinds feature, May 2024) and has affected users for over a year.
Root Cause
Scroll wheel events pass through
handleKeybinds()withkeysym=0andpressed=true. Since scroll events have no "release" phase, this0gets inserted intom_mkKeysand never removed, corrupting the keysym tracking state and breaking all subsequent multikey bind matching.Fix
Skip keysym tracking when
key.keysym == 0, as these events don't correspond to actual keys and shouldn't affect the pressed-keysym state.Testing
binds = Alt_R, K, exec, kitty