From 24fa69dbfa6c5c7a80456218f2c31179864c4d77 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 17 Feb 2014 02:38:07 +0100 Subject: lua: add mechanism for script provided key bindings There was already an undocumented mechanism provided by mp.set_key_bindings and other functions, but this was relatively verbose, and also weird. It was mainly to make the OSC happy (including being efficient and supporting weird corner cases), while the new functions try to be a bit simpler. This also provides a way to let users rebind script-provided commands. (This mechanism is less efficient, because it's O(n^2) for n added key bindings, but it shouldn't matter.) --- player/lua.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'player/lua.c') diff --git a/player/lua.c b/player/lua.c index dbe97cc278..e813d84bce 100644 --- a/player/lua.c +++ b/player/lua.c @@ -666,7 +666,18 @@ static int script_input_define_section(lua_State *L) struct MPContext *mpctx = get_mpctx(L); char *section = (char *)luaL_checkstring(L, 1); char *contents = (char *)luaL_checkstring(L, 2); - mp_input_define_section(mpctx->input, section, "