mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 21:27:08 +00:00
Add support for tracking mouse movements.
Patch by Zuxy Meng (zuxy meng at gmail com) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22441 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
5c9ee0eb4d
commit
edfdc4c0b5
@ -1,5 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <limits.h>
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#include "osdep/keycodes.h"
|
||||
#include "input/input.h"
|
||||
@ -10,6 +12,7 @@
|
||||
#include "w32_common.h"
|
||||
|
||||
extern void mplayer_put_key(int code);
|
||||
extern int enable_mouse_movements;
|
||||
|
||||
#ifndef MONITOR_DEFAULTTOPRIMARY
|
||||
#define MONITOR_DEFAULTTOPRIMARY 1
|
||||
@ -111,6 +114,14 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
||||
if (!vo_nomouse_input)
|
||||
mplayer_put_key(MOUSE_BTN2);
|
||||
break;
|
||||
case WM_MOUSEMOVE:
|
||||
if (enable_mouse_movements) {
|
||||
char cmd_str[40];
|
||||
snprintf(cmd_str, sizeof(cmd_str), "set_mouse_pos %i %i",
|
||||
GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
|
||||
mp_input_queue_cmd(mp_input_parse_cmd(cmd_str));
|
||||
}
|
||||
break;
|
||||
case WM_MOUSEWHEEL:
|
||||
if (!vo_nomouse_input) {
|
||||
int x = GET_WHEEL_DELTA_WPARAM(wParam);
|
||||
|
Loading…
Reference in New Issue
Block a user