mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-13 12:09:35 +03:00
When using a non-US keyboard layout and pressing ctrl+key when the key matches an English key in the default layout, send that to the program running in the terminal automatically
See #2000
This commit is contained in:
parent
2cbbd84987
commit
d45d553eaf
@ -7,6 +7,10 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
|
||||
0.20.0 [future]
|
||||
----------------------
|
||||
|
||||
- When using a non-US keyboard layout and pressing :kbd:`ctrl+key` when
|
||||
the key matches an English key, send that to the program running in the
|
||||
terminal automatically (:iss:`2000`)
|
||||
|
||||
- Add support for the color settings stack that XTerm copied from us without
|
||||
acknowledgement and decided to use incompatible escape codes for.
|
||||
|
||||
|
@ -374,6 +374,13 @@ encode_key(const KeyEvent *ev, char *output) {
|
||||
output[0] = 0;
|
||||
return 1;
|
||||
}
|
||||
if ((ev->mods.value == CTRL || ev->mods.value == ALT || ev->mods.value == (CTRL | ALT)) && ev->alternate_key && !is_legacy_ascii_key(ev->key) && is_legacy_ascii_key(ev->alternate_key)) {
|
||||
KeyEvent alternate = *ev;
|
||||
alternate.key = ev->alternate_key;
|
||||
alternate.alternate_key = 0;
|
||||
int ret = encode_printable_ascii_key_legacy(&alternate, output);
|
||||
if (ret > 0) return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user