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 /server-client.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 'server-client.c')
-rw-r--r-- | server-client.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server-client.c b/server-client.c index cec305f0..c81edcc7 100644 --- a/server-client.c +++ b/server-client.c @@ -907,8 +907,8 @@ server_client_handle_key(struct client *c, key_code key) * The prefix always takes precedence and forces a switch to the prefix * table, unless we are already there. */ -retry: key0 = (key & ~KEYC_XTERM); +retry: if ((key0 == (key_code)options_get_number(s->options, "prefix") || key0 == (key_code)options_get_number(s->options, "prefix2")) && strcmp(table->name, "prefix") != 0) { @@ -980,6 +980,10 @@ retry: * switch the client back to the root table and try again. */ log_debug("not found in key table %s", table->name); + if (key0 != KEYC_ANY) { + key0 = KEYC_ANY; + goto retry; + } if (!server_client_is_default_key_table(c, table) || (c->flags & CLIENT_REPEAT)) { server_client_set_key_table(c, NULL); |