From d8a79a1ca801a4b0de0c316764c52872639fc3d5 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Mon, 24 Feb 2025 12:48:09 +0100 Subject: [PATCH] osc.lua: allow wheel bindings for custom buttons --- DOCS/man/osc.rst | 6 ++++++ player/lua/osc.lua | 2 ++ 2 files changed, 8 insertions(+) diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 2568b42e088f2..7b2c65f24033d 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -612,6 +612,12 @@ and ``topbar`` layouts. custom_button_2_content=🔀 custom_button_2_mbtn_left_command=playlist-shuffle + custom_button_3_content=⏱ + custom_button_3_mbtn_left_command=add speed 1 + custom_button_3_mbtn_right_command=set speed 1 + custom_button_3_wheel_up_command=add speed 0.25 + custom_button_3_wheel_down_command=add speed -0.25 + Script Commands ~~~~~~~~~~~~~~~ diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 8b71b8f9ce3f3..548707bfb2300 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -129,6 +129,8 @@ for i = 1, 99 do user_opts["custom_button_" .. i .. "_mbtn_left_command"] = "" user_opts["custom_button_" .. i .. "_mbtn_mid_command"] = "" user_opts["custom_button_" .. i .. "_mbtn_right_command"] = "" + user_opts["custom_button_" .. i .. "_wheel_down_command"] = "" + user_opts["custom_button_" .. i .. "_wheel_up_command"] = "" end local icon_font = "mpv-osd-symbols"