diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 19a75921a0..131d471797 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -121,6 +121,7 @@ vol fs ============= ================================================ left-click toggle fullscreen + right-click toggle whether the window is maximized ============= ================================================ Key Bindings @@ -562,6 +563,12 @@ clicked. ``mbtn_mid`` commands are also triggered with ``shift+mbtn_left``. ``volume_wheel_up_command=add volume 5`` +``fullscreen_mbtn_left_command="cycle fullscreen"`` + +``fullscreen_mbtn_mid_command=`` + +``fullscreen_mbtn_right_command="cycle window-maximized"`` + Script Commands ~~~~~~~~~~~~~~~ diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 71f2079c27..f8967b74d3 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -111,6 +111,10 @@ local user_opts = { volume_mbtn_right_command = "script-binding select/select-audio-device; script-message-to osc osc-hide", volume_wheel_down_command = "add volume -5", volume_wheel_up_command = "add volume 5", + + fullscreen_mbtn_left_command = "cycle fullscreen", + fullscreen_mbtn_mid_command = "", + fullscreen_mbtn_right_command = "cycle window-maximized", -- luacheck: pop } @@ -1901,8 +1905,10 @@ local function osc_init() return ("\238\132\136") end end - ne.eventresponder["mbtn_left_up"] = - function () mp.commandv("cycle", "fullscreen") end + ne.eventresponder["mbtn_left_up"] = command_callback(user_opts.fullscreen_mbtn_left_command) + ne.eventresponder["shift+mbtn_left_up"] = command_callback( + user_opts.fullscreen_mbtn_mid_command) + ne.eventresponder["mbtn_right_up"] = command_callback(user_opts.fullscreen_mbtn_right_command) --seekbar ne = new_element("seekbar", "slider")