mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
input: must have all required modifiers to un-shift a symbol
When detecting, and repairing, “broken” key bindings (where the key binding itself explicitly lists a modifier that is consumed by the final symbol - e.g “Shift+W”), don’t just look for an intersection between the set of modifiers needed to produce the final symbol, and the modifiers listed in the key combo. Instead, check if the key combo has *all* the required modifiers. Example: Shift+AltGr+w produces Page_Down. I.e. Page_Down is the _shifted_ symbol, ‘w’ is the un-shifted symbol, and Shift+AltGr are the modifiers required to shift ‘w’ to Page_Down. If we have the key combo Shift+Page_Down, foot would, correctly, determine that Page_Down is a shifted symbol. It would find the Shift+AltGr modifier set, and since the intersection of “Shift+AltGr” and “Shift” (from our key combo) is non-empty, foot would (incorrectly) determine that we can, and should, replace Page_Down with its un-shifted symbol ‘w’. This is completely wrong, since Shift+w does _not_ produce Page_Down. Closes #407
This commit is contained in:
parent
eccf2b674e
commit
0c85905972
2 changed files with 6 additions and 1 deletions
|
|
@ -30,6 +30,11 @@
|
|||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
|
||||
* Logic that repairs invalid key bindings ended up breaking valid key
|
||||
bindings instead (https://codeberg.org/dnkl/foot/issues/407).
|
||||
|
||||
|
||||
### Security
|
||||
### Contributors
|
||||
|
||||
|
|
|
|||
2
input.c
2
input.c
|
|
@ -450,7 +450,7 @@ maybe_repair_key_combo(const struct seat *seat,
|
|||
|
||||
/* Check if key combo’s modifier set intersects */
|
||||
for (size_t j = 0; j < mod_mask_count; j++) {
|
||||
if (!(mod_masks[j] & mods))
|
||||
if ((mod_masks[j] & mods) != mod_masks[j])
|
||||
continue;
|
||||
|
||||
char combo[64] = {0};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue