summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/input-keys.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-05-19 10:59:10 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-05-19 10:59:10 +0000
commitcfc0d63ef2bed2ff1c2677bac127d177ca81a937 (patch)
treec1379e9926d02c869447a76abf8f65302820cba3 /usr.bin/tmux/input-keys.c
parent2df3d9b86834856a561f94bc2be40aff0639e730 (diff)
Some other ctrl keys need to be translated with extended keys on.
Diffstat (limited to 'usr.bin/tmux/input-keys.c')
-rw-r--r--usr.bin/tmux/input-keys.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/usr.bin/tmux/input-keys.c b/usr.bin/tmux/input-keys.c
index 4936fa35b36..2a7909fcfc8 100644
--- a/usr.bin/tmux/input-keys.c
+++ b/usr.bin/tmux/input-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: input-keys.c,v 1.76 2020/05/16 16:44:54 nicm Exp $ */
+/* $OpenBSD: input-keys.c,v 1.77 2020/05/19 10:59:09 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -498,10 +498,35 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)
/* No builtin key sequence; construct an extended key sequence. */
if (~s->mode & MODE_KEXTENDED) {
- if ((key & KEYC_MASK_MODIFIERS) == KEYC_CTRL &&
- (key & KEYC_MASK_KEY) < KEYC_BASE)
- return (input_key(s, bev, key & ~KEYC_CTRL));
- goto missing;
+ justkey = (key & KEYC_MASK_KEY);
+ if ((key & KEYC_MASK_MODIFIERS) != KEYC_CTRL)
+ goto missing;
+ switch (justkey) {
+ case ' ':
+ case '2':
+ key = 0||(key & ~KEYC_MASK_KEY);
+ break;
+ case '|':
+ key = 28|(key & ~KEYC_MASK_KEY);
+ break;
+ case '6':
+ key = 30|(key & ~KEYC_MASK_KEY);
+ break;
+ case '-':
+ case '/':
+ key = 31|(key & ~KEYC_MASK_KEY);
+ break;
+ case '?':
+ key = 127|(key & ~KEYC_MASK_KEY);
+ break;
+ default:
+ if (justkey >= 'A' && justkey <= '_')
+ key = (justkey - 'A')|(key & ~KEYC_MASK_KEY);
+ else if (justkey >= 'a' && justkey <= '~')
+ key = (justkey - 96)|(key & ~KEYC_MASK_KEY);
+ break;
+ }
+ return (input_key(s, bev, key & ~KEYC_CTRL));
}
outkey = (key & KEYC_MASK_KEY);
switch (key & KEYC_MASK_MODIFIERS) {