input: don’t allow non-significant modifiers when matching untranslated symbols

When matching “untranslated” bindings (by matching the base symbol of
the key, e.g. ctrl+shift+2 in US layout), require that no
non-significant modifiers are active.

This fixes an issue where AltGr was “ignored”, and would cause certain
combinations to match a key binding.

Example: ctrl+altgr+0, on many European layouts matched against the
default ctrl+0 (reset the font size), instead of emitting ^]

To make this work, we now need to filter out “locked”
modifiers (e.g. NumLock and CapsLock). Otherwise having e.g. NumLock
active would prevent *all* untranslated matching to fail.

Closes #983
This commit is contained in:
Daniel Eklöf 2022-03-19 18:59:15 +01:00
parent dcdbb3613c
commit 1e63dddb89
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
6 changed files with 33 additions and 9 deletions

View file

@ -89,6 +89,8 @@
overrides on the command line.
* Crash when seat has no keyboard
(https://codeberg.org/dnkl/foot/issues/963).
* Key presses with e.g. `AltGr` triggering key combinations with the
base symbol (https://codeberg.org/dnkl/foot/issues/983).
### Security