diff options
author | wm4 <wm4@nowhere> | 2015-12-23 19:10:38 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-23 19:10:48 +0100 |
commit | 3e1aed8f40f0c35f78c74502050630519895c972 (patch) | |
tree | 72a8cd2608e7a841c0efd268ddbb7ff0a687745f /input/cmd_parse.c | |
parent | ff520054c86898613ae58f358b8554760ef30e15 (diff) | |
download | mpv-3e1aed8f40f0c35f78c74502050630519895c972.tar.bz2 mpv-3e1aed8f40f0c35f78c74502050630519895c972.tar.xz |
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.
Diffstat (limited to 'input/cmd_parse.c')
-rw-r--r-- | input/cmd_parse.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/input/cmd_parse.c b/input/cmd_parse.c index ba35cd5e1c..c2c3270e97 100644 --- a/input/cmd_parse.c +++ b/input/cmd_parse.c @@ -417,6 +417,7 @@ mp_cmd_t *mp_cmd_clone(mp_cmd_t *cmd) m_option_copy(ret->args[i].type, &ret->args[i].v, &cmd->args[i].v); } ret->original = bstrdup(ret, cmd->original); + ret->key_name = talloc_strdup(ret, ret->key_name); if (cmd->id == MP_CMD_COMMAND_LIST) { struct mp_cmd *prev = NULL; |