mirror of
https://github.com/mpv-player/mpv
synced 2025-01-09 01:36:25 +01:00
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).
This commit is contained in:
parent
38b55f8cef
commit
84d86719fc
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user