changeset 12927:ba7d39185cc1

support for passing mouse events on to MPlayer
author reimar
date Sun, 01 Aug 2004 20:13:42 +0000
parents 6eb8d78e2d47
children bc760f3f129e
files libvo/w32_common.c
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/w32_common.c	Sun Aug 01 11:17:27 2004 +0000
+++ b/libvo/w32_common.c	Sun Aug 01 20:13:42 2004 +0000
@@ -58,12 +58,33 @@
 	    mplayer_put_key(wParam);
 	    break;
 	case WM_LBUTTONDOWN:
+	    if (!vo_nomouse_input && (vo_fs || (wParam & MK_CONTROL))) {
+		mplayer_put_key(MOUSE_BTN0);
+		break;
+	    }
 	    if (!vo_fs) {
 		ReleaseCapture();
 		SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0);
 		return 0;
 	    }
 	    break;
+	case WM_MBUTTONDOWN:
+	    if (!vo_nomouse_input)
+		mplayer_put_key(MOUSE_BTN1);
+	    break;
+	case WM_RBUTTONDOWN:
+	    if (!vo_nomouse_input)
+		mplayer_put_key(MOUSE_BTN2);
+	    break;
+	case WM_MOUSEWHEEL:
+	    if (!vo_nomouse_input) {
+		int x = GET_WHEEL_DELTA_WPARAM(wParam);
+		if (x > 0)
+		    mplayer_put_key(MOUSE_BTN3);
+		else
+		    mplayer_put_key(MOUSE_BTN4);
+		break;
+	    }
     }
     
     return DefWindowProc(hWnd, message, wParam, lParam);