[MPlayer-dev-eng] [PATCH] add "xbutton" support to vo_directx

Joey Parrish joey at nicewarrior.org
Thu Aug 26 22:21:55 CEST 2004


Hello,

This patch adds "xbutton" support to vo_directx.  These are the 4 or 5
button mice with buttons on the sides which Microsoft assigns to "back"
and "forward" for IE.  These two buttons will show up as 5 and 6 in
MPlayer's input layer.

These button events will only happen on win2k or winxp, but the code
should compile and run on 95 & 98 still.

Ok to commit?

--Joey

-- 
"There are trivial truths and there are great truths.  The opposite of a
trivial truth is plainly false.  The opposite of a great truth is also true."
  --Neils Bohr
-------------- next part --------------
diff -ur main.cvs/libvo/vo_directx.c main.temp/libvo/vo_directx.c
--- main.cvs/libvo/vo_directx.c	2004-08-25 06:34:46.759200000 +0000
+++ main.temp/libvo/vo_directx.c	2004-08-26 19:38:50.718449600 +0000
@@ -35,6 +35,12 @@
 #include "aspect.h"
 #include "geometry.h"
 
+#ifndef WM_XBUTTONDOWN
+# define WM_XBUTTONDOWN    0x020B
+# define WM_XBUTTONUP      0x020C
+# define WM_XBUTTONDBLCLK  0x020D
+#endif
+
 static LPDIRECTDRAW7        g_lpdd = NULL;          //DirectDraw Object
 static LPDIRECTDRAWSURFACE7  g_lpddsPrimary = NULL;  //Primary Surface: viewport through the Desktop
 static LPDIRECTDRAWSURFACE7  g_lpddsOverlay = NULL;  //Overlay Surface
@@ -907,6 +913,16 @@
 				mplayer_put_key(MOUSE_BTN4);
 			break;
 		}
+        case WM_XBUTTONDOWN:
+		{
+			if (vo_nomouse_input)
+				break;
+			if (HIWORD(wParam) == 1)
+				mplayer_put_key(MOUSE_BTN5);
+			else
+				mplayer_put_key(MOUSE_BTN6);
+			break;
+		}
 		
     }
 	return DefWindowProc(hWnd, message, wParam, lParam);


More information about the MPlayer-dev-eng mailing list