"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tty-keys.c" between
tmux-3.2.tar.gz and tmux-3.2a.tar.gz

About: tmux is a terminal multiplexer that lets you switch easily between several programs in one terminal.

tty-keys.c  (tmux-3.2):tty-keys.c  (tmux-3.2a)
skipping to change at line 255 skipping to change at line 255
}; };
static const key_code tty_default_xterm_modifiers[] = { static const key_code tty_default_xterm_modifiers[] = {
0, 0,
0, 0,
KEYC_SHIFT, KEYC_SHIFT,
KEYC_META|KEYC_IMPLIED_META, KEYC_META|KEYC_IMPLIED_META,
KEYC_SHIFT|KEYC_META|KEYC_IMPLIED_META, KEYC_SHIFT|KEYC_META|KEYC_IMPLIED_META,
KEYC_CTRL, KEYC_CTRL,
KEYC_SHIFT|KEYC_CTRL, KEYC_SHIFT|KEYC_CTRL,
KEYC_META|KEYC_IMPLIED_META|KEYC_CTRL, KEYC_META|KEYC_IMPLIED_META|KEYC_CTRL,
KEYC_SHIFT|KEYC_META|KEYC_IMPLIED_META|KEYC_CTRL KEYC_SHIFT|KEYC_META|KEYC_IMPLIED_META|KEYC_CTRL,
KEYC_META|KEYC_IMPLIED_META
}; };
/* /*
* Default terminfo(5) keys. Any keys that have builtin modifiers (that is, * Default terminfo(5) keys. Any keys that have builtin modifiers (that is,
* where the key itself contains the modifiers) has the KEYC_XTERM flag set so * where the key itself contains the modifiers) has the KEYC_XTERM flag set so
* a leading escape is not treated as meta (and probably removed). * a leading escape is not treated as meta (and probably removed).
*/ */
struct tty_default_key_code { struct tty_default_key_code {
enum tty_code_code code; enum tty_code_code code;
key_code key; key_code key;
skipping to change at line 947 skipping to change at line 948
break; break;
case 6: case 6:
nkey |= (KEYC_SHIFT|KEYC_CTRL); nkey |= (KEYC_SHIFT|KEYC_CTRL);
break; break;
case 7: case 7:
nkey |= (KEYC_META|KEYC_CTRL); nkey |= (KEYC_META|KEYC_CTRL);
break; break;
case 8: case 8:
nkey |= (KEYC_SHIFT|KEYC_META|KEYC_IMPLIED_META|KEYC_CTRL); nkey |= (KEYC_SHIFT|KEYC_META|KEYC_IMPLIED_META|KEYC_CTRL);
break; break;
case 9:
nkey |= (KEYC_META|KEYC_IMPLIED_META);
break;
default: default:
*key = KEYC_NONE; *key = KEYC_NONE;
break; break;
} }
/* /*
* Don't allow both KEYC_CTRL and as an implied modifier. Also convert * Don't allow both KEYC_CTRL and as an implied modifier. Also convert
* C-X into C-x and so on. * C-X into C-x and so on.
*/ */
if (nkey & KEYC_CTRL) { if (nkey & KEYC_CTRL) {
onlykey = (nkey & KEYC_MASK_KEY); onlykey = (nkey & KEYC_MASK_KEY);
if (onlykey < 32) { if (onlykey < 32 &&
if (onlykey != 9) onlykey != 9 &&
onlykey = (nkey & ~KEYC_CTRL); onlykey != 13 &&
else onlykey != 27)
onlykey = (9|KEYC_CTRL); /* nothing */;
} else { else if (onlykey >= 97 && onlykey <= 122)
if (onlykey >= 97 && onlykey <= 122) onlykey -= 96;
onlykey -= 96; else if (onlykey >= 64 && onlykey <= 95)
else if (onlykey >= 64 && onlykey <= 95) onlykey -= 64;
onlykey -= 64; else if (onlykey == 32)
else if (onlykey == 32) onlykey = 0;
onlykey = 0; else if (onlykey == 63)
else if (onlykey == 63) onlykey = 127;
onlykey = 127; else
onlykey |= ((nkey & KEYC_MASK_MODIFIERS) & ~KEYC_CTRL); onlykey |= KEYC_CTRL;
} nkey = onlykey|((nkey & KEYC_MASK_MODIFIERS) & ~KEYC_CTRL);
nkey = onlykey;
} }
if (log_get_level() != 0) { if (log_get_level() != 0) {
log_debug("%s: extended key %.*s is %llx (%s)", c->name, log_debug("%s: extended key %.*s is %llx (%s)", c->name,
(int)*size, buf, nkey, key_string_lookup_key(nkey, 1)); (int)*size, buf, nkey, key_string_lookup_key(nkey, 1));
} }
*key = nkey; *key = nkey;
return (0); return (0);
} }
 End of changes. 3 change blocks. 
18 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)