summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2022-02-28 09:24:22 +0000
committernicm <nicm>2022-02-28 09:24:22 +0000
commit2e59ff2db95d573f56237776a10314b412721491 (patch)
tree399545626e7ddaa2f70962566a502766c8a606f5
parente8d6d53a7b4af435806fefa5c9f6cef4387f3451 (diff)
Map control keys back to an ASCII uppercase letter when passing them on
as extended keys.
-rw-r--r--input-keys.c9
1 files 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;