summaryrefslogtreecommitdiffstats
path: root/input/input.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-23 19:13:45 +0100
committerwm4 <wm4@nowhere>2015-12-23 19:13:45 +0100
commitb0381d27eb19d8f70f4f711d41dd342c616ae843 (patch)
tree89eee7586c847ba69cd33d9d96be20ff3553646b /input/input.c
parent3e1aed8f40f0c35f78c74502050630519895c972 (diff)
downloadmpv-b0381d27eb19d8f70f4f711d41dd342c616ae843.tar.bz2
mpv-b0381d27eb19d8f70f4f711d41dd342c616ae843.tar.xz
input: add a catch-all "unmapped" command
This can be used to grab all unmapped keys. Fixes #2612.
Diffstat (limited to 'input/input.c')
-rw-r--r--input/input.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/input/input.c b/input/input.c
index 58907ccd50..24281fe99e 100644
--- a/input/input.c
+++ b/input/input.c
@@ -446,7 +446,9 @@ static mp_cmd_t *get_cmd_from_keys(struct input_ctx *ictx, char *force_section,
return handle_test(ictx, code);
struct cmd_bind *cmd = find_any_bind_for_key(ictx, force_section, code);
- if (cmd == NULL) {
+ if (!cmd)
+ cmd = find_any_bind_for_key(ictx, force_section, MP_KEY_UNMAPPED);
+ if (!cmd) {
if (code == MP_KEY_CLOSE_WIN)
return mp_input_parse_cmd_strv(ictx->log, (const char*[]){"quit", 0});
int msgl = MSGL_WARN;