Change how extended ctrl keys are processed to fix C-S-Tab and C-;.

This commit is contained in:
nicm 2021-04-13 12:26:34 +00:00 committed by Nicholas Marriott
parent 2ab53d30d0
commit bab7a9a085

View File

@ -955,23 +955,19 @@ tty_keys_extended_key(struct tty *tty, const char *buf, size_t len,
*/ */
if (nkey & KEYC_CTRL) { if (nkey & KEYC_CTRL) {
onlykey = (nkey & KEYC_MASK_KEY); onlykey = (nkey & KEYC_MASK_KEY);
if (onlykey < 32) { if (onlykey < 32 && onlykey != 9)
if (onlykey != 9) /* nothing */;
onlykey = (nkey & ~KEYC_CTRL); else if (onlykey >= 97 && onlykey <= 122)
else onlykey -= 96;
onlykey = (9|KEYC_CTRL); else if (onlykey >= 64 && onlykey <= 95)
} else { onlykey -= 64;
if (onlykey >= 97 && onlykey <= 122) else if (onlykey == 32)
onlykey -= 96; onlykey = 0;
else if (onlykey >= 64 && onlykey <= 95) else if (onlykey == 63)
onlykey -= 64; onlykey = 127;
else if (onlykey == 32) else
onlykey = 0; onlykey |= KEYC_CTRL;
else if (onlykey == 63) nkey = onlykey|((nkey & KEYC_MASK_MODIFIERS) & ~KEYC_CTRL);
onlykey = 127;
onlykey |= ((nkey & KEYC_MASK_MODIFIERS) & ~KEYC_CTRL);
}
nkey = onlykey;
} }
if (log_get_level() != 0) { if (log_get_level() != 0) {