[vlc-commits] commit: Add left and right wheel buttons ( =?UTF-8?Q?R=C3=A9mi=20Denis=2DCourmont=20?=)

git at videolan.org git at videolan.org
Sun Dec 5 05:08:55 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Dec  5 06:01:47 2010 +0200| [87626923e323619696e1add713adca746c25b115] | committer: Rémi Denis-Courmont 

Add left and right wheel buttons

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

 include/vlc_mouse.h      |    2 ++
 src/video_output/event.h |   18 +++++++++---------
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/include/vlc_mouse.h b/include/vlc_mouse.h
index a4b1d6b..e671a74 100644
--- a/include/vlc_mouse.h
+++ b/include/vlc_mouse.h
@@ -34,6 +34,8 @@ enum
     MOUSE_BUTTON_RIGHT,
     MOUSE_BUTTON_WHEEL_UP,
     MOUSE_BUTTON_WHEEL_DOWN,
+    MOUSE_BUTTON_WHEEL_LEFT,
+    MOUSE_BUTTON_WHEEL_RIGHT,
     MOUSE_BUTTON_MAX
 };
 
diff --git a/src/video_output/event.h b/src/video_output/event.h
index 6c1415e..a6397a3 100644
--- a/src/video_output/event.h
+++ b/src/video_output/event.h
@@ -56,6 +56,7 @@ static inline void vout_SendEventMouseMoved(vout_thread_t *vout, int x, int y)
 }
 static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
 {
+    int key;
     var_OrInteger(vout, "mouse-button-down", 1 << button);
 
     switch (button)
@@ -67,21 +68,20 @@ static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
         var_GetCoords(vout, "mouse-moved", &x, &y);
         var_SetCoords(vout, "mouse-clicked", x, y);
         var_SetBool(vout->p_libvlc, "intf-popupmenu", false);
-        break;
+        return;
     }
     case MOUSE_BUTTON_CENTER:
         var_ToggleBool(vout->p_libvlc, "intf-show");
-        break;
+        return;
     case MOUSE_BUTTON_RIGHT:
         var_SetBool(vout->p_libvlc, "intf-popupmenu", true);
-        break;
-    case MOUSE_BUTTON_WHEEL_UP:
-        vout_SendEventKey(vout, KEY_MOUSEWHEELUP);
-        break;
-    case MOUSE_BUTTON_WHEEL_DOWN:
-        vout_SendEventKey(vout, KEY_MOUSEWHEELDOWN);
-        break;
+        return;
+    case MOUSE_BUTTON_WHEEL_UP:    key = KEY_MOUSEWHEELUP;    break;
+    case MOUSE_BUTTON_WHEEL_DOWN:  key = KEY_MOUSEWHEELDOWN;  break;
+    case MOUSE_BUTTON_WHEEL_LEFT:  key = KEY_MOUSEWHEELLEFT;  break;
+    case MOUSE_BUTTON_WHEEL_RIGHT: key = KEY_MOUSEWHEELRIGHT; break;
     }
+    vout_SendEventKey(vout, key);
 }
 static inline void vout_SendEventMouseReleased(vout_thread_t *vout, int button)
 {



More information about the vlc-commits mailing list