# HG changeset patch # User reimar # Date 1173014451 0 # Node ID 8f95e2a3c797eec7a2a5d9d7455e67f07c224252 # Parent dd99089c892bdd70f12beba02c559f3f375ff32f Add support for tracking mouse movements. Patch by Zuxy Meng (zuxy meng at gmail com) diff -r dd99089c892b -r 8f95e2a3c797 libvo/w32_common.c --- a/libvo/w32_common.c Sun Mar 04 12:59:48 2007 +0000 +++ b/libvo/w32_common.c Sun Mar 04 13:20:51 2007 +0000 @@ -1,5 +1,7 @@ +#include #include #include +#include #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 @@ 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);