diff options
author | nicm <nicm> | 2022-02-28 09:24:22 +0000 |
---|---|---|
committer | nicm <nicm> | 2022-02-28 09:24:22 +0000 |
commit | 2e59ff2db95d573f56237776a10314b412721491 (patch) | |
tree | 399545626e7ddaa2f70962566a502766c8a606f5 /input-keys.c | |
parent | e8d6d53a7b4af435806fefa5c9f6cef4387f3451 (diff) | |
download | rtmux-2e59ff2db95d573f56237776a10314b412721491.tar.gz rtmux-2e59ff2db95d573f56237776a10314b412721491.tar.bz2 rtmux-2e59ff2db95d573f56237776a10314b412721491.zip |
Map control keys back to an ASCII uppercase letter when passing them on
as extended keys.
Diffstat (limited to 'input-keys.c')
-rw-r--r-- | input-keys.c | 9 |
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; |