changeset 3779:5f599ed92fb9 gsoc2008_manymouse

Small improvements
author Szymon Wilczek <kazeuser@gmail.com>
date Thu, 14 Aug 2008 08:28:19 +0000
parents a9370b995ded
children c62835c40174
files src/video/win32/SDL_win32mouse.c src/video/win32/SDL_win32window.c
diffstat 2 files changed, 32 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/win32/SDL_win32mouse.c	Wed Aug 06 11:49:28 2008 +0000
+++ b/src/video/win32/SDL_win32mouse.c	Thu Aug 14 08:28:19 2008 +0000
@@ -54,6 +54,7 @@
 	int tmp=0;
 	char* buffer=NULL;
 	char* tab="wacom";/*since windows does't give us handles to tablets, we have to detect a tablet by it's name*/
+	const char *rdp = "rdp_mou";
 
     SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
 
@@ -78,6 +79,7 @@
 
 	for(i=0;i<devCount;++i)
 	{
+		int is_rdp=0;
 		int j;
 		int k;
 		char *default_device_name="Pointing device xx";
@@ -110,7 +112,6 @@
 		{
 			continue;
 		}
-
 		buffer+=4;
 		tmp-=4;
 
@@ -132,6 +133,35 @@
 	SDL_memcpy(key_name, reg_key_root, SDL_strlen (reg_key_root));
     SDL_memcpy(key_name + (SDL_strlen (reg_key_root)), buffer, j + 1);
     
+	l=SDL_strlen(key_name);
+	is_rdp=0;
+	if(l>=7)
+	{
+		for(j=0;j<l-7;++j)
+		{
+			for(k=0;k<7;++k)
+			{
+				if(rdp[k]!=SDL_tolower((unsigned char)key_name[j+k]))
+				{
+					break;
+				}
+			}
+			if(k==7)
+			{
+				is_rdp=1;
+				break;
+			}
+		}
+	}
+	if(is_rdp==1)
+	{
+		SDL_free(buffer);
+		SDL_free(key_name);
+		SDL_free(device_name);
+		is_rdp=0;
+		continue;
+	}
+	
 	/*we're opening the registry key to get the mouse name*/
 
 	rc = RegOpenKeyExA(HKEY_LOCAL_MACHINE, key_name, 0, KEY_READ, &hkey);
@@ -197,7 +227,6 @@
 void
 WIN_QuitMouse(_THIS)
 {
-	int i;
     SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
 	/*let's delete all of the mouses*/
 	SDL_MouseQuit();
--- a/src/video/win32/SDL_win32window.c	Wed Aug 06 11:49:28 2008 +0000
+++ b/src/video/win32/SDL_win32window.c	Thu Aug 14 08:28:19 2008 +0000
@@ -39,7 +39,7 @@
 
 #include <wintab.h>
 /*we're telling wintab that we want to receive movement, button events and pressure information in packets*/
-#define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE)
+#define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR)
 #define PACKETMODE 0
 #include <pktdef.h>