Reorganize structure of key_code so that it can be built directly by

bitshifts rather than a load of huge switches, from Dane Jensen in
GitHub issue 4953.
This commit is contained in:
nicm
2026-03-31 11:46:43 +00:00
parent 022b5cf193
commit 2ff0dd3fef
4 changed files with 209 additions and 1507 deletions

View File

@@ -674,8 +674,7 @@ input_key(struct screen *s, struct bufferevent *bev, key_code key)
}
/* Ignore internal function key codes. */
if ((key >= KEYC_BASE && key < KEYC_BASE_END) ||
(key >= KEYC_USER && key < KEYC_USER_END)) {
if (KEYC_IS_USER(key) || KEYC_IS_SPECIAL(key) || KEYC_IS_MOUSE(key)) {
log_debug("%s: ignoring key 0x%llx", __func__, key);
return (0);
}