diff options
author | nicm <nicm> | 2022-02-28 09:24:22 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2022-04-06 14:19:50 +0100 |
commit | 9947f7416a3e43c30abcfbc5092c7e3e7b122dcb (patch) | |
tree | 05c565be6d0df28efd0e224d00c0bf1927e6a318 | |
parent | c030d6fe362eec41ccd5a5cb21321ef8cf07314b (diff) | |
download | rtmux-9947f7416a3e43c30abcfbc5092c7e3e7b122dcb.tar.gz rtmux-9947f7416a3e43c30abcfbc5092c7e3e7b122dcb.tar.bz2 rtmux-9947f7416a3e43c30abcfbc5092c7e3e7b122dcb.zip |
Map control keys back to an ASCII uppercase letter when passing them on
as extended keys.
-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 47614aa0..f478cb95 100644 --- a/input-keys.c +++ b/input-keys.c @@ -417,7 +417,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; @@ -518,7 +518,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; |