osc.lua: add script message to show up the OSC

Add a way to briefly show the OSC, which is useful to check file name,
playback progress and time left, etc.

Fix issue #3826
This commit is contained in:
Crend King 2024-06-14 19:38:57 -07:00 committed by Kacper Michajłow
parent df6b16c0ca
commit c9ea2798a4
3 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1 @@
add `osc-show` script message

View File

@ -499,7 +499,10 @@ in ``input.conf``, or sent by other scripts.
``osc-visibility``
Controls visibility mode ``never`` / ``auto`` (on mouse move) / ``always``
and also ``cycle`` to cycle between the modes
and also ``cycle`` to cycle between the modes.
``osc-show``
Triggers the OSC to show up, just as if user moved mouse.
Example

View File

@ -2925,6 +2925,7 @@ local function idlescreen_visibility(mode, no_osd)
end
mp.register_script_message("osc-visibility", visibility_mode)
mp.register_script_message("osc-show", show_osc)
mp.add_key_binding(nil, "visibility", function() visibility_mode("cycle") end)
mp.register_script_message("osc-idlescreen", idlescreen_visibility)