From 84d86719fc923b3df2ad101a12bbbff931dd0578 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 10 Jun 2011 15:44:55 +0200 Subject: Windows: vo/input: handle WM_XBUTTONDOWN message WM_XBUTTONDOWN is used for extra mouse buttons (mapped to button 5 and button 6 in mplayer2). Previously only vo_directx handled this message. Add support to w32_common.c event handling too (used by vo_direct3d and vo_gl/vo_gl2 on Windows). --- libvo/w32_common.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'libvo/w32_common.c') diff --git a/libvo/w32_common.c b/libvo/w32_common.c index 9b89602f40..0c512f3d2d 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -31,6 +31,12 @@ #include "w32_common.h" #include "mp_fifo.h" +#ifndef WM_XBUTTONDOWN +# define WM_XBUTTONDOWN 0x020B +# define WM_XBUTTONUP 0x020C +# define WM_XBUTTONDBLCLK 0x020D +#endif + #ifndef MONITOR_DEFAULTTOPRIMARY #define MONITOR_DEFAULTTOPRIMARY 1 #endif @@ -170,8 +176,17 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l mplayer_put_key(MOUSE_BTN3); else mplayer_put_key(MOUSE_BTN4); - break; } + break; + case WM_XBUTTONDOWN: + if (!vo_nomouse_input) { + int x = HIWORD(wParam); + if (x == 1) + mplayer_put_key(MOUSE_BTN5); + else // if (x == 2) + mplayer_put_key(MOUSE_BTN6); + } + break; } return DefWindowProc(hWnd, message, wParam, lParam); -- cgit v1.2.3