mirror of
https://github.com/mpv-player/mpv
synced 2024-12-20 13:52:10 +00:00
w32_common: use the proper keycodes for XBUTTON1/2
mpv's mouse button numbering is based on X11, which means XBUTTON1 and 2 on Windows (the "back" and "forward" buttons) should map to MOUSE_BTN7 and 8 in mpv. MOUSE_BTN5 and 6 refer to the horizontal scroll buttons on mouses that have them.
This commit is contained in:
parent
18a45a42d5
commit
e6a6677630
@ -1097,11 +1097,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam,
|
||||
return TRUE;
|
||||
case WM_XBUTTONDOWN:
|
||||
handle_mouse_down(w32,
|
||||
HIWORD(wParam) == 1 ? MP_MOUSE_BTN5 : MP_MOUSE_BTN6,
|
||||
HIWORD(wParam) == 1 ? MP_MOUSE_BTN7 : MP_MOUSE_BTN8,
|
||||
GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
|
||||
break;
|
||||
case WM_XBUTTONUP:
|
||||
handle_mouse_up(w32, HIWORD(wParam) == 1 ? MP_MOUSE_BTN5 : MP_MOUSE_BTN6);
|
||||
handle_mouse_up(w32, HIWORD(wParam) == 1 ? MP_MOUSE_BTN7 : MP_MOUSE_BTN8);
|
||||
break;
|
||||
case WM_DISPLAYCHANGE:
|
||||
force_update_display_info(w32);
|
||||
|
Loading…
Reference in New Issue
Block a user