diff options
author | nicm <nicm> | 2018-07-16 08:48:22 +0000 |
---|---|---|
committer | nicm <nicm> | 2018-07-16 08:48:22 +0000 |
commit | 0d88f8a78bc0d91ab6fa53c9109f7316bfe5ffbb (patch) | |
tree | 8e177b235f513cb521e21f194bbd84125e706d53 /key-string.c | |
parent | ff67ef945dd9b93b7d62ea1ec8077d86f3c57d12 (diff) | |
download | rtmux-0d88f8a78bc0d91ab6fa53c9109f7316bfe5ffbb.tar.gz rtmux-0d88f8a78bc0d91ab6fa53c9109f7316bfe5ffbb.tar.bz2 rtmux-0d88f8a78bc0d91ab6fa53c9109f7316bfe5ffbb.zip |
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.
Diffstat (limited to 'key-string.c')
-rw-r--r-- | key-string.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/key-string.c b/key-string.c index d630d778..45073efd 100644 --- a/key-string.c +++ b/key-string.c @@ -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) |