Separate key flags and modifiers, log key flags, make the "xterm" flag more

explicit and fix M- keys with a leading escape.
This commit is contained in:
Nicholas Marriott
2020-05-15 12:16:41 +01:00
parent 031d4864a9
commit 340fd691cb
16 changed files with 260 additions and 222 deletions

View File

@@ -1040,7 +1040,7 @@ out:
key |= KEYC_SHIFT;
if (log_get_level() != 0)
log_debug("mouse key is %s", key_string_lookup_key (key));
log_debug("mouse key is %s", key_string_lookup_key (key, 1));
return (key);
}
@@ -1172,7 +1172,7 @@ table_changed:
* The prefix always takes precedence and forces a switch to the prefix
* table, unless we are already there.
*/
key0 = (key & ~KEYC_XTERM);
key0 = (key & (KEYC_MASK_KEY|KEYC_MASK_MODIFIERS));
if ((key0 == (key_code)options_get_number(s->options, "prefix") ||
key0 == (key_code)options_get_number(s->options, "prefix2")) &&
strcmp(table->name, "prefix") != 0) {