From 3e1aed8f40f0c35f78c74502050630519895c972 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 23 Dec 2015 19:10:38 +0100 Subject: input: add key name to script-binding command response The "script-binding" command is used by the Lua scripting wrapper to register key bindings on the fly. It's also the only way to get fine- grained information about key events (such as separate key up/down events). This information is sent via a "key-binding" message when the state of a key changes. Extend it to send name of the mapped key itself. Previously, it was assumed that the user just uses an unique identifier for the binding's name, so it wasn't needed. With this change, a user can map exactly the same command to multiple keys, which is useful especially with the next commit. Part of #2612. --- input/input.h | 1 + 1 file changed, 1 insertion(+) (limited to 'input/input.h') diff --git a/input/input.h b/input/input.h index 2b2299d5cc..6462555326 100644 --- a/input/input.h +++ b/input/input.h @@ -86,6 +86,7 @@ typedef struct mp_cmd { double scale; // for scaling numeric arguments const struct mp_cmd_def *def; char *sender; // name of the client API user which sent this + char *key_name; // string representation of the key binding } mp_cmd_t; struct mp_input_src { -- cgit v1.2.3