mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
kitty kbd: don't generate release events for plain Enter+Tab+Backspace
From the specification:
The Enter, Tab and Backspace keys will not have release events
unless Report all keys as escape codes is also set, so that the
user can still type reset at a shell prompt when a program that
sets this mode ends without resetting it.
Closes #1892
This commit is contained in:
parent
e38ec79be1
commit
e851d44ac9
2 changed files with 18 additions and 3 deletions
|
|
@ -79,8 +79,12 @@
|
|||
support ([#1865][1865]).
|
||||
* Run-time changes to the window title, and the app ID now require the
|
||||
new value to consist of printable characters only.
|
||||
* Kitty keyboard protocol: Enter, Tab and Backspace no longer report
|
||||
_release_ events unless _"Report all keys as escape codes"_ is
|
||||
enabled ([#1892][1892]).
|
||||
|
||||
[1865]: https://codeberg.org/dnkl/foot/issues/1865
|
||||
[1892]: https://codeberg.org/dnkl/foot/issues/1892
|
||||
|
||||
|
||||
### Deprecated
|
||||
|
|
|
|||
17
input.c
17
input.c
|
|
@ -1236,9 +1236,20 @@ kitty_kbd_protocol(struct seat *seat, struct terminal *term,
|
|||
|
||||
if ((mods & ~locked & ~consumed) == 0) {
|
||||
switch (sym) {
|
||||
case XKB_KEY_Return: term_to_slave(term, "\r", 1); return true;
|
||||
case XKB_KEY_BackSpace: term_to_slave(term, "\x7f", 1); return true;
|
||||
case XKB_KEY_Tab: term_to_slave(term, "\t", 1); return true;
|
||||
case XKB_KEY_Return:
|
||||
if (!released)
|
||||
term_to_slave(term, "\r", 1);
|
||||
return true;
|
||||
|
||||
case XKB_KEY_BackSpace:
|
||||
if (!released)
|
||||
term_to_slave(term, "\x7f", 1);
|
||||
return true;
|
||||
|
||||
case XKB_KEY_Tab:
|
||||
if (!released)
|
||||
term_to_slave(term, "\t", 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue