Add an "Any" key to run a command if a key is pressed that is not bound

in the current key table. GitHub issue 1404.
This commit is contained in:
nicm
2018-07-16 08:48:22 +00:00
parent ff67ef945d
commit 0d88f8a78b
3 changed files with 13 additions and 2 deletions

View File

@ -166,9 +166,11 @@ key_string_lookup_string(const char *string)
enum utf8_state more;
wchar_t wc;
/* Is this no key? */
/* Is this no key or any key? */
if (strcasecmp(string, "None") == 0)
return (KEYC_NONE);
if (strcasecmp(string, "Any") == 0)
return (KEYC_ANY);
/* Is this a hexadecimal value? */
if (string[0] == '0' && string[1] == 'x') {
@ -251,6 +253,8 @@ key_string_lookup_key(key_code key)
/* Handle special keys. */
if (key == KEYC_UNKNOWN)
return ("Unknown");
if (key == KEYC_ANY)
return ("Any");
if (key == KEYC_FOCUS_IN)
return ("FocusIn");
if (key == KEYC_FOCUS_OUT)