[vlc-commits] hotkeys: fix mouse wheel down event

Victorien Le Couviour--Tuffet git at videolan.org
Mon Mar 4 11:21:47 CET 2019


vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Tue Nov 13 12:09:03 2018 +0100| [4b584f2cc3879e7b6c39d92fe08d2527a223bea4] | committer: Thomas Guillem

hotkeys: fix mouse wheel down event

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4b584f2cc3879e7b6c39d92fe08d2527a223bea4
---

 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 325501f3d1..4f211a0f64 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -200,8 +200,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(vlc_object_instance(p_intf), "key-pressed",
-                           i - MOUSE_BUTTON_WHEEL_UP + KEY_MOUSEWHEELUP);
+        {
+            int keycode = KEY_MOUSEWHEEL_FROM_BUTTON(i);
+            var_SetInteger(vlc_object_instance(p_intf), "key-pressed", keycode);
+        }
 
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list