input: add support for modifyOtherKeys=2

Similar to modifyOtherKeys=1 (foot’s default, and only, mode), except
that:

* All modifiers (and not just Ctrl) generate \E[27;m;n~ escapes
* Regular keys (with modifiers) also generate \E[27;m;n~ escapes (for
  example, C-h no longer generates ^H, but \E[27;5;104~)

For our keymap based lookups, this is handled by adding
MOD_MODIFY_OTHER_KEYS_STATE<N> variants.

For “generic” keys, we simply adjust the conditions for when to emit a
\E[27;m;n~ escape - the only requirement is that at least one modifier
is active.
This commit is contained in:
Daniel Eklöf 2021-11-11 17:43:39 +01:00
parent 9412389051
commit 4a74050999
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 90 additions and 32 deletions

View file

@ -308,6 +308,7 @@ struct terminal {
bool focus_events;
bool alt_scrolling;
bool modify_escape_key;
bool modify_other_keys_2; /* True when modifyOtherKeys=2 (i.e. “CSI >4;2m”) */
enum cursor_origin origin;
enum cursor_keys cursor_keys_mode;
enum keypad_keys keypad_keys_mode;