aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-12-07 20:48:42 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-12-08 16:54:37 +0000
commitc0cfec89e0093c10253416e26efdcb8e38f7fd95 (patch)
tree05dbd04ace6c9f0b02283fa0a0c99cee281a2878 /input.c
parentkitty: implement “base layout key” in “report alternate key” (diff)
kitty: report-alternate: apply base-layout key to composed characters
Diffstat (limited to 'input.c')
-rw-r--r--input.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/input.c b/input.c
index b5876baa..7587f729 100644
--- a/input.c
+++ b/input.c
@@ -1437,22 +1437,24 @@ emit_escapes:
if (key == 0)
key = sym_to_use;
- if (report_alternate) {
- /* The *shifted* key. May be the same as the unshifted
- * key - if so, this is filtered out below, when
- * emitting the CSI */
+ if (report_alternate)
alternate = xkb_keysym_to_utf32(sym);
+ }
+
+ if (report_alternate) {
+ /* The *shifted* key. May be the same as the unshifted
+ * key - if so, this is filtered out below, when
+ * emitting the CSI */
- /* Base layout key. I.e the symbol the pressed key
- * produces in the base/default layout (layout idx
- * 0) */
- const xkb_keysym_t *base_syms;
- int base_sym_count = xkb_keymap_key_get_syms_by_level(
- seat->kbd.xkb_keymap, ctx->key, 0, 0, &base_syms);
+ /* Base layout key. I.e the symbol the pressed key
+ * produces in the base/default layout (layout idx
+ * 0) */
+ const xkb_keysym_t *base_syms;
+ int base_sym_count = xkb_keymap_key_get_syms_by_level(
+ seat->kbd.xkb_keymap, ctx->key, 0, 0, &base_syms);
- if (base_sym_count > 0)
- base = xkb_keysym_to_utf32(base_syms[0]);
- }
+ if (base_sym_count > 0)
+ base = xkb_keysym_to_utf32(base_syms[0]);
}
final = 'u';