Commit 87626923 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Add left and right wheel buttons

parent 938d8c45
...@@ -34,6 +34,8 @@ enum ...@@ -34,6 +34,8 @@ enum
MOUSE_BUTTON_RIGHT, MOUSE_BUTTON_RIGHT,
MOUSE_BUTTON_WHEEL_UP, MOUSE_BUTTON_WHEEL_UP,
MOUSE_BUTTON_WHEEL_DOWN, MOUSE_BUTTON_WHEEL_DOWN,
MOUSE_BUTTON_WHEEL_LEFT,
MOUSE_BUTTON_WHEEL_RIGHT,
MOUSE_BUTTON_MAX MOUSE_BUTTON_MAX
}; };
......
...@@ -56,6 +56,7 @@ static inline void vout_SendEventMouseMoved(vout_thread_t *vout, int x, int y) ...@@ -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) static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
{ {
int key;
var_OrInteger(vout, "mouse-button-down", 1 << button); var_OrInteger(vout, "mouse-button-down", 1 << button);
switch (button) switch (button)
...@@ -67,21 +68,20 @@ static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button) ...@@ -67,21 +68,20 @@ static inline void vout_SendEventMousePressed(vout_thread_t *vout, int button)
var_GetCoords(vout, "mouse-moved", &x, &y); var_GetCoords(vout, "mouse-moved", &x, &y);
var_SetCoords(vout, "mouse-clicked", x, y); var_SetCoords(vout, "mouse-clicked", x, y);
var_SetBool(vout->p_libvlc, "intf-popupmenu", false); var_SetBool(vout->p_libvlc, "intf-popupmenu", false);
break; return;
} }
case MOUSE_BUTTON_CENTER: case MOUSE_BUTTON_CENTER:
var_ToggleBool(vout->p_libvlc, "intf-show"); var_ToggleBool(vout->p_libvlc, "intf-show");
break; return;
case MOUSE_BUTTON_RIGHT: case MOUSE_BUTTON_RIGHT:
var_SetBool(vout->p_libvlc, "intf-popupmenu", true); var_SetBool(vout->p_libvlc, "intf-popupmenu", true);
break; return;
case MOUSE_BUTTON_WHEEL_UP: case MOUSE_BUTTON_WHEEL_UP: key = KEY_MOUSEWHEELUP; break;
vout_SendEventKey(vout, KEY_MOUSEWHEELUP); case MOUSE_BUTTON_WHEEL_DOWN: key = KEY_MOUSEWHEELDOWN; break;
break; case MOUSE_BUTTON_WHEEL_LEFT: key = KEY_MOUSEWHEELLEFT; break;
case MOUSE_BUTTON_WHEEL_DOWN: case MOUSE_BUTTON_WHEEL_RIGHT: key = KEY_MOUSEWHEELRIGHT; break;
vout_SendEventKey(vout, KEY_MOUSEWHEELDOWN);
break;
} }
vout_SendEventKey(vout, key);
} }
static inline void vout_SendEventMouseReleased(vout_thread_t *vout, int button) static inline void vout_SendEventMouseReleased(vout_thread_t *vout, int button)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment