[vlc-devel] [PATCH 2/2] hotkeys: fix mouse wheel down event

Victorien Le Couviour--Tuffet victorien.lecouviour.tuffet at gmail.com
Wed Nov 28 15:11:36 CET 2018


---
 modules/control/hotkeys.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index 6c60deaf09..334abab534 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -201,8 +201,10 @@ static int ButtonEvent( vlc_object_t *p_this, char const *psz_var,
 
     for (int i = MOUSE_BUTTON_WHEEL_UP; i <= MOUSE_BUTTON_WHEEL_RIGHT; i++)
         if (pressed & (1 << i))
-            var_SetInteger(p_intf->obj.libvlc, "key-pressed",
-                           i - MOUSE_BUTTON_WHEEL_UP + KEY_MOUSEWHEELUP);
+        {
+            int keycode = KEY_MOUSEWHEEL_FROM_BUTTON(i);
+            var_SetInteger(p_intf->obj.libvlc, "key-pressed", keycode);
+        }
 
     return VLC_SUCCESS;
 }
-- 
2.19.1



More information about the vlc-devel mailing list