input: kitty: use base symbol instead of lowering the symbol

When emitting an escape sequence for a printable character, with
modifiers (e.g. ctrl+a), use the key’s base symbol instead of
“lowering” it.

This means we now handle e.g. ctrl+2 and ctrl+shift+2, with Swedish
layout.

There’s a twist however. We *only* use the base symbol if the
modifiers that is used to “generate” the symbol are “significant”.

Significant modifiers are, in this context, modifiers we can encode in
the kitty escape sequences.

In the Swedish layout, pressing AltGr+2 results in ‘@’. AltGr cannot
be encoded in the kitty protocol. If we were to use the base symbol,
AltGr+Alt+2 would result in exactly the same escape sequence as Alt+2.
This commit is contained in:
Daniel Eklöf 2021-11-20 20:31:59 +01:00
parent ab5dfa3f3b
commit b9d03c16a6
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 141 additions and 21 deletions

View file

@ -195,6 +195,8 @@ struct seat {
xkb_mod_index_t mod_alt;
xkb_mod_index_t mod_ctrl;
xkb_mod_index_t mod_meta;
xkb_mod_index_t mod_caps;
xkb_mod_index_t mod_num;
xkb_keycode_t key_arrow_up;
xkb_keycode_t key_arrow_down;