From b0381d27eb19d8f70f4f711d41dd342c616ae843 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 23 Dec 2015 19:13:45 +0100 Subject: input: add a catch-all "unmapped" command This can be used to grab all unmapped keys. Fixes #2612. --- input/input.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'input/input.c') 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; -- cgit v1.2.3