changeset 12020:1604d07d3539

mouse support by Nehal Mistry <nehalmistry at gmx.net>
author faust3
date Sat, 13 Mar 2004 16:37:12 +0000
parents 6ede5366bc47
children cd33d1e3b709
files libvo/vo_directx.c
diffstat 1 files changed, 30 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_directx.c	Sat Mar 13 16:25:08 2004 +0000
+++ b/libvo/vo_directx.c	Sat Mar 13 16:37:12 2004 +0000
@@ -30,6 +30,7 @@
 #include "fastmemcpy.h"
 #include "../input/input.h"
 #include "../osdep/keycodes.h"
+#include "../input/mouse.h"
 #include "../mp_msg.h"
 #include "aspect.h"
 #include "geometry.h"
@@ -908,6 +909,35 @@
 			mplayer_put_key(wParam);
 			break;
 		}
+        case WM_LBUTTONDOWN:
+		{
+			if (!vo_nomouse_input)
+				mplayer_put_key(MOUSE_BTN0);
+			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)
+				break;
+			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);