summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorRudolf Polzer <divverent@xonotic.org>2011-06-10 15:44:55 +0200
committerUoti Urpala <uau@mplayer2.org>2011-06-19 04:05:36 +0300
commit84d86719fc923b3df2ad101a12bbbff931dd0578 (patch)
tree281e0137346733c52ebc110114e96e46dea5d98c /libvo
parent38b55f8cef78560037ec19c167ee6ec8745091b9 (diff)
downloadmpv-84d86719fc923b3df2ad101a12bbbff931dd0578.tar.bz2
mpv-84d86719fc923b3df2ad101a12bbbff931dd0578.tar.xz
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).
Diffstat (limited to 'libvo')
-rw-r--r--libvo/w32_common.c17
1 files changed, 16 insertions, 1 deletions
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);