mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
input: kitty: printables are emitted as text, even if Caps- or Num-Lock is in effect
Not sure if this is the best/correct way to do it. But kitty seems to ignore at least Num-Lock for printables, while it _does_ affect other keys. For example, Return, which usually emits ‘\r’, are affected by Num-Lock and emit ‘CSI 13;129u’. Note that as soon as some other modifier is in effect, the Num-Lock modifier *is* encoded in the CSI, also for printables.
This commit is contained in:
parent
db746d72ed
commit
e744cee760
1 changed files with 15 additions and 4 deletions
19
input.c
19
input.c
|
|
@ -1145,11 +1145,22 @@ kitty_kbd_protocol(struct seat *seat, struct terminal *term,
|
||||||
case XKB_KEY_BackSpace: term_to_slave(term, "\x7f", 1); return;
|
case XKB_KEY_BackSpace: term_to_slave(term, "\x7f", 1); return;
|
||||||
case XKB_KEY_Tab: term_to_slave(term, "\t", 1); return;
|
case XKB_KEY_Tab: term_to_slave(term, "\t", 1); return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (iswprint(utf32)) {
|
/*
|
||||||
term_to_slave(term, utf8, count);
|
* Printables without any modifiers are printed as is.
|
||||||
return;
|
*
|
||||||
}
|
* TODO: plain text keys (a-z, 0-9 etc) are still printed as text,
|
||||||
|
* even when NumLock is active, despite NumLock being a
|
||||||
|
* significant modifier, *and* despite NumLock affecting other
|
||||||
|
* keys, like Return and Backspace; figure out if there’s some
|
||||||
|
* better magic than filtering out Caps- and Num-Lock here..
|
||||||
|
*/
|
||||||
|
if (iswprint(utf32) && (effective & ~(1 << seat->kbd.mod_caps |
|
||||||
|
1 << seat->kbd.mod_num)) == 0)
|
||||||
|
{
|
||||||
|
term_to_slave(term, utf8, count);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int encoded_mods = 0;
|
unsigned int encoded_mods = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue