From 022dbfc977c3d88cf693ce184c2f86073ae12428 Mon Sep 17 00:00:00 2001 From: NRK Date: Wed, 30 Aug 2023 01:18:59 +0600 Subject: [PATCH] osc: add scrolling to the seekbar the osc currently allows for changing volume via scrolling when on top of the volume icon. this does the same thing for the seekbar by allowing seeking via scroll. --- DOCS/man/osc.rst | 1 + player/lua/osc.lua | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/DOCS/man/osc.rst b/DOCS/man/osc.rst index 1653e0cc7b..352d28f180 100644 --- a/DOCS/man/osc.rst +++ b/DOCS/man/osc.rst @@ -85,6 +85,7 @@ seekbar ============= ================================================ left-click seek to position + mouse wheel seek forward/backward ============= ================================================ time left diff --git a/player/lua/osc.lua b/player/lua/osc.lua index 0126d4da31..98e8558a15 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -2046,6 +2046,10 @@ function osc_init() "absolute-percent", "exact") end ne.eventresponder["reset"] = function (element) element.state.lastseek = nil end + ne.eventresponder["wheel_up_press"] = + function () mp.commandv("osd-auto", "seek", 10) end + ne.eventresponder["wheel_down_press"] = + function () mp.commandv("osd-auto", "seek", -10) end -- tc_left (current pos)