diff --git a/.luacheckrc b/.luacheckrc index dda48b031d..d096c1c368 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -57,6 +57,7 @@ local mp_globals = { disable_key_bindings = {}, enable_key_bindings = {}, find_config_file = {}, + flush_keybindings = {}, format_time = {}, get_mouse_pos = {}, set_key_bindings = {}, @@ -78,7 +79,6 @@ local mp_internal = { UNKNOWN_TYPE = { fields = { info = {}, type = {} }}, _legacy_overlay = { fields = { res_x = {}, res_y = {}, data = {}, update = {} }}, cancel_timer = {}, - flush_keybindings = {}, get_osd_margins = {}, input_define_section = {}, input_disable_section = {}, diff --git a/player/lua/console.lua b/player/lua/console.lua index 5024c86479..0df5a7fe3f 100644 --- a/player/lua/console.lua +++ b/player/lua/console.lua @@ -1730,6 +1730,10 @@ mp.register_script_message("get-input", function (args) end set_active(true) + + -- We want to ensure the keybindings have been set before sending the "opened" event + -- in case scripts want to override our bindings. + mp.flush_keybindings() mp.commandv("script-message-to", input_caller, input_caller_handler, "opened") end)