mirror of
https://github.com/mpv-player/mpv
synced 2024-11-18 21:16:10 +01:00
osd: override user bindings for OSC input
E.g. binding MOUSE_BTN0 always used the user defined binding. While it
is ok that the user can override mouse_move and mouse_leave (for
whatever reasons), we want to strictly override the bindings when input
is sent to the OSC itself.
Regression since 03624a1
.
This commit is contained in:
parent
f3c933e5d3
commit
9a7a3d125b
@ -750,9 +750,9 @@ static int script_input_define_section(lua_State *L)
|
||||
char *contents = (char *)luaL_checkstring(L, 2);
|
||||
char *flags = (char *)luaL_optstring(L, 3, "");
|
||||
bool builtin = true;
|
||||
if (strcmp(flags, "builtin") == 0) {
|
||||
if (strcmp(flags, "default") == 0) {
|
||||
builtin = true;
|
||||
} else if (strcmp(flags, "default") == 0) {
|
||||
} else if (strcmp(flags, "force") == 0) {
|
||||
builtin = false;
|
||||
} else if (strcmp(flags, "") == 0) {
|
||||
//pass
|
||||
|
@ -27,7 +27,7 @@ local default_section = "input_dispatch_" .. mp.script_name
|
||||
-- callback can be a string too, in which case the following will be added like
|
||||
-- an input.conf line: key .. " " .. callback
|
||||
-- (And callback_down is ignored.)
|
||||
function mp.set_key_bindings(list, section)
|
||||
function mp.set_key_bindings(list, section, flags)
|
||||
local cfg = ""
|
||||
for i = 1, #list do
|
||||
local entry = list[i]
|
||||
@ -42,7 +42,7 @@ function mp.set_key_bindings(list, section)
|
||||
cfg = cfg .. key .. " " .. cb .. "\n"
|
||||
end
|
||||
end
|
||||
mp.input_define_section(section or default_section, cfg)
|
||||
mp.input_define_section(section or default_section, cfg, flags)
|
||||
end
|
||||
|
||||
function mp.enable_key_bindings(section, flags)
|
||||
|
@ -1279,5 +1279,5 @@ mp.set_key_bindings({
|
||||
{"mouse_btn0_dbl", "ignore"},
|
||||
{"shift+mouse_btn0_dbl", "ignore"},
|
||||
{"mouse_btn2_dbl", "ignore"},
|
||||
}, "input")
|
||||
}, "input", "force")
|
||||
mp.enable_key_bindings("input")
|
||||
|
Loading…
Reference in New Issue
Block a user