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:
nicm
2020-05-16 16:35:13 +00:00
parent e2a26740b9
commit 292b335ca5
11 changed files with 63 additions and 46 deletions

4
menu.c
View File

@ -81,7 +81,7 @@ menu_add_item(struct menu *menu, const struct menu_item *item,
return;
}
if (*s != '-' && item->key != KEYC_UNKNOWN && item->key != KEYC_NONE) {
key = key_string_lookup_key(item->key);
key = key_string_lookup_key(item->key, 0);
xasprintf(&name, "%s#[default] #[align=right](%s)", s, key);
} else
xasprintf(&name, "%s", s);
@ -226,7 +226,7 @@ menu_key_cb(struct client *c, struct key_event *event)
goto chosen;
}
}
switch (event->key) {
switch (event->key & ~KEYC_MASK_FLAGS) {
case KEYC_UP:
case 'k':
if (old == -1)