summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-03 15:44:41 +0100
committerwm4 <wm4@nowhere>2014-12-03 15:46:55 +0100
commit0c6d85f6c36703d5e6fe1c2696fb4376cee5b46e (patch)
treea23561293ae2516f249b8f4fa5a5c262e39c8f57 /input
parent10bc277984cebe0a094698aec9a689c4fdb942cf (diff)
downloadmpv-0c6d85f6c36703d5e6fe1c2696fb4376cee5b46e.tar.bz2
mpv-0c6d85f6c36703d5e6fe1c2696fb4376cee5b46e.tar.xz
input, lua: make removing key bindings work
This just kept adding bindings to the input section, rather than defining it. One bad effect was that mp.remove_key_binding() in Lua didn't work.
Diffstat (limited to 'input')
-rw-r--r--input/input.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/input/input.c b/input/input.c
index c624e7de67..7bb13c5c52 100644
--- a/input/input.c
+++ b/input/input.c
@@ -1019,14 +1019,15 @@ void mp_input_define_section(struct input_ctx *ictx, char *name, char *location,
if (!name || !name[0])
return; // parse_config() changes semantics with restrict_section==empty
input_lock(ictx);
+ // Delete:
+ struct cmd_bind_section *bs = get_bind_section(ictx, bstr0(name));
+ remove_binds(bs, builtin);
if (contents) {
+ // Redefine:
parse_config(ictx, builtin, bstr0(contents), location, name);
} else {
// Disable:
mp_input_disable_section(ictx, name);
- // Delete:
- struct cmd_bind_section *bs = get_bind_section(ictx, bstr0(name));
- remove_binds(bs, builtin);
}
input_unlock(ictx);
}