diff --git a/docs/changelog.rst b/docs/changelog.rst index 92ac2d8bd..cbdd9a214 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -7,6 +7,10 @@ To update |kitty|, :doc:`follow the instructions `. 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. diff --git a/kitty/key_encoding.c b/kitty/key_encoding.c index a48f230d2..059a55990 100644 --- a/kitty/key_encoding.c +++ b/kitty/key_encoding.c @@ -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; + } } }