table.
-/* $OpenBSD: input-keys.c,v 1.96 2024/08/21 04:55:57 nicm Exp $ */
+/* $OpenBSD: input-keys.c,v 1.97 2024/08/23 13:25:39 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
return (0);
}
- onlykey = key & KEYC_MASK_KEY;
-
/* Prevent TAB and RET from being swallowed by C0 remapping logic. */
+ onlykey = key & KEYC_MASK_KEY;
if (onlykey == '\r' || onlykey == '\t')
key &= ~KEYC_CTRL;
/* Is this backtab? */
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. */
key = '\011' | (key & ~KEYC_MASK_KEY) | KEYC_SHIFT;
} else {
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
* depending on the client mode.
-/* $OpenBSD: key-string.c,v 1.74 2024/08/22 09:05:51 nicm Exp $ */
+/* $OpenBSD: key-string.c,v 1.75 2024/08/23 13:25:39 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
s = "MouseMoveBorder";
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));
strlcat(out, tmp, sizeof out);
goto out;
-/* $OpenBSD: tmux.h,v 1.1221 2024/08/21 04:17:09 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.1222 2024/08/23 13:25:39 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
*/
#define KEYC_BASE 0x0000000010e000ULL
#define KEYC_USER 0x0000000010f000ULL
+#define KEYC_USER_END (KEYC_USER + KEYC_NUSER)
/* Key modifier bits. */
#define KEYC_META 0x00100000000000ULL
(((key) & KEYC_MASK_KEY) < KEYC_BASE || \
((key) & KEYC_MASK_KEY) >= KEYC_BASE_END) && \
(((key) & KEYC_MASK_KEY) < KEYC_USER || \
- ((key) & KEYC_MASK_KEY) >= KEYC_USER + KEYC_NUSER))
+ ((key) & KEYC_MASK_KEY) >= KEYC_USER_END))
/* Multiple click timeout. */
#define KEYC_CLICK_TIMEOUT 300