aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-07-26 16:44:29 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-07-28 17:02:25 +0000
commit801970aa332da5786f91d2f9410d4ed9f440c6ec (patch)
tree002fb5ebc3139141746830e9425cf594889fd62a
parentkeymap: change alt+escape to emit \E\E instead of a CSI 27 sequence (diff)
input: kitty: always treat composed characters as ‘printable’
Certain dead key combinations results different escape sequences in foot, compared to kitty, when the kitty keyboard protocol is used. if (composed && is_text) key = utf32; else { key = xkb_keysym_to_utf32(sym_to_use); if (key == 0) return false; /* The *shifted* key. May be the same as the unshifted * key - if so, this is filtered out below, when * emitting the CSI */ alternate = xkb_keysym_to_utf32(sym); } If is_text=false, we’ll fall through to the non-composed logic. is_text is set to true if the character is printable *and* there aren’t any non-consumed modifiers enabled. shift+space is one example where shift is *not* consumed (typically - may be layouts where it is). As a result, pressing ", followed by shift+space with the international english keyboard layout (where " is a dead key) results in different sequences in foot and kitty. This patch fixes this by always treating composed characters as printable. Closes #1120
-rw-r--r--CHANGELOG.md4
-rw-r--r--input.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ea0f5803..29eaf084 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -88,11 +88,15 @@
* Crash when application emitted an invalid `CSI 38;5;<idx>m`, `CSI
38:5:<idx>m`, `CSI 48;5;<idx>m` or `CSI 48:5:<idx>m` sequence
([#1111][1111]).
+* Certain dead-key combinations resulting in different escape
+ sequences compared to kitty, when the kitty keyboard protocol is
+ used ([#1120][1120]).
[1055]: https://codeberg.org/dnkl/foot/issues/1055
[1092]: https://codeberg.org/dnkl/foot/issues/1092
[1097]: https://codeberg.org/dnkl/foot/issues/1097
[1111]: https://codeberg.org/dnkl/foot/issues/1111
+[1120]: https://codeberg.org/dnkl/foot/issues/1120
### Security
diff --git a/input.c b/input.c
index d4598cf6..e0f21c6e 100644
--- a/input.c
+++ b/input.c
@@ -1239,7 +1239,7 @@ emit_escapes:
? ctx->level0_syms.syms[0]
: sym;
- if (composed && is_text)
+ if (composed)
key = utf32;
else {
key = xkb_keysym_to_utf32(sym_to_use);