mirror of
https://github.com/tmux/tmux.git
synced 2024-12-04 11:55:56 +00:00
Ignore internal function keys if they have not got an entry in the key
table.
This commit is contained in:
parent
6e9a914014
commit
08be883297
12
input-keys.c
12
input-keys.c
@ -499,9 +499,8 @@ input_key_vt10x(struct bufferevent *bev, key_code key)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
onlykey = key & KEYC_MASK_KEY;
|
|
||||||
|
|
||||||
/* Prevent TAB and RET from being swallowed by C0 remapping logic. */
|
/* Prevent TAB and RET from being swallowed by C0 remapping logic. */
|
||||||
|
onlykey = key & KEYC_MASK_KEY;
|
||||||
if (onlykey == '\r' || onlykey == '\t')
|
if (onlykey == '\r' || onlykey == '\t')
|
||||||
key &= ~KEYC_CTRL;
|
key &= ~KEYC_CTRL;
|
||||||
|
|
||||||
@ -594,7 +593,7 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)
|
|||||||
|
|
||||||
/* Is this backtab? */
|
/* Is this backtab? */
|
||||||
if ((key & KEYC_MASK_KEY) == KEYC_BTAB) {
|
if ((key & KEYC_MASK_KEY) == KEYC_BTAB) {
|
||||||
if (s->mode & EXTENDED_KEY_MODES) {
|
if ((s->mode & EXTENDED_KEY_MODES) != 0) {
|
||||||
/* When in xterm extended mode, remap into S-Tab. */
|
/* When in xterm extended mode, remap into S-Tab. */
|
||||||
key = '\011' | (key & ~KEYC_MASK_KEY) | KEYC_SHIFT;
|
key = '\011' | (key & ~KEYC_MASK_KEY) | KEYC_SHIFT;
|
||||||
} else {
|
} else {
|
||||||
@ -651,6 +650,13 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ignore internal function key codes. */
|
||||||
|
if ((key >= KEYC_BASE && key < KEYC_BASE_END) ||
|
||||||
|
(key >= KEYC_USER && key < KEYC_USER_END)) {
|
||||||
|
log_debug("%s: ignoring key 0x%llx", __func__, key);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* No builtin key sequence; construct an extended key sequence
|
* No builtin key sequence; construct an extended key sequence
|
||||||
* depending on the client mode.
|
* depending on the client mode.
|
||||||
|
@ -410,7 +410,7 @@ key_string_lookup_key(key_code key, int with_flags)
|
|||||||
s = "MouseMoveBorder";
|
s = "MouseMoveBorder";
|
||||||
goto append;
|
goto append;
|
||||||
}
|
}
|
||||||
if (key >= KEYC_USER && key < KEYC_USER + KEYC_NUSER) {
|
if (key >= KEYC_USER && key < KEYC_USER_END) {
|
||||||
snprintf(tmp, sizeof tmp, "User%u", (u_int)(key - KEYC_USER));
|
snprintf(tmp, sizeof tmp, "User%u", (u_int)(key - KEYC_USER));
|
||||||
strlcat(out, tmp, sizeof out);
|
strlcat(out, tmp, sizeof out);
|
||||||
goto out;
|
goto out;
|
||||||
|
3
tmux.h
3
tmux.h
@ -125,6 +125,7 @@ struct winlink;
|
|||||||
*/
|
*/
|
||||||
#define KEYC_BASE 0x0000000010e000ULL
|
#define KEYC_BASE 0x0000000010e000ULL
|
||||||
#define KEYC_USER 0x0000000010f000ULL
|
#define KEYC_USER 0x0000000010f000ULL
|
||||||
|
#define KEYC_USER_END (KEYC_USER + KEYC_NUSER)
|
||||||
|
|
||||||
/* Key modifier bits. */
|
/* Key modifier bits. */
|
||||||
#define KEYC_META 0x00100000000000ULL
|
#define KEYC_META 0x00100000000000ULL
|
||||||
@ -159,7 +160,7 @@ struct winlink;
|
|||||||
(((key) & KEYC_MASK_KEY) < KEYC_BASE || \
|
(((key) & KEYC_MASK_KEY) < KEYC_BASE || \
|
||||||
((key) & KEYC_MASK_KEY) >= KEYC_BASE_END) && \
|
((key) & KEYC_MASK_KEY) >= KEYC_BASE_END) && \
|
||||||
(((key) & KEYC_MASK_KEY) < KEYC_USER || \
|
(((key) & KEYC_MASK_KEY) < KEYC_USER || \
|
||||||
((key) & KEYC_MASK_KEY) >= KEYC_USER + KEYC_NUSER))
|
((key) & KEYC_MASK_KEY) >= KEYC_USER_END))
|
||||||
|
|
||||||
/* Multiple click timeout. */
|
/* Multiple click timeout. */
|
||||||
#define KEYC_CLICK_TIMEOUT 300
|
#define KEYC_CLICK_TIMEOUT 300
|
||||||
|
Loading…
Reference in New Issue
Block a user