From 2e59ff2db95d573f56237776a10314b412721491 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 28 Feb 2022 09:24:22 +0000 Subject: Map control keys back to an ASCII uppercase letter when passing them on as extended keys. --- input-keys.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/input-keys.c b/input-keys.c index 0b618407..ae67b486 100644 --- a/input-keys.c +++ b/input-keys.c @@ -418,7 +418,7 @@ int input_key(struct screen *s, struct bufferevent *bev, key_code key) { struct input_key_entry *ike; - key_code justkey, newkey, outkey; + key_code justkey, newkey, outkey, modifiers; struct utf8_data ud; char tmp[64], modifier; @@ -519,7 +519,12 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key) return (input_key(s, bev, key & ~KEYC_CTRL)); } outkey = (key & KEYC_MASK_KEY); - switch (key & KEYC_MASK_MODIFIERS) { + modifiers = (key & KEYC_MASK_MODIFIERS); + if (outkey < ' ') { + outkey = 64 + outkey; + modifiers |= KEYC_CTRL; + } + switch (modifiers) { case KEYC_SHIFT: modifier = '2'; break; -- cgit v1.2.3