Small improvements gsoc2008_manymouse
authorSzymon Wilczek
Thu, 14 Aug 2008 08:28:19 +0000
branchgsoc2008_manymouse
changeset 37795f599ed92fb9
parent 3778 a9370b995ded
child 4412 c62835c40174
Small improvements
src/video/win32/SDL_win32mouse.c
src/video/win32/SDL_win32window.c
     1.1 --- a/src/video/win32/SDL_win32mouse.c	Wed Aug 06 11:49:28 2008 +0000
     1.2 +++ b/src/video/win32/SDL_win32mouse.c	Thu Aug 14 08:28:19 2008 +0000
     1.3 @@ -54,6 +54,7 @@
     1.4  	int tmp=0;
     1.5  	char* buffer=NULL;
     1.6  	char* tab="wacom";/*since windows does't give us handles to tablets, we have to detect a tablet by it's name*/
     1.7 +	const char *rdp = "rdp_mou";
     1.8  
     1.9      SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    1.10  
    1.11 @@ -78,6 +79,7 @@
    1.12  
    1.13  	for(i=0;i<devCount;++i)
    1.14  	{
    1.15 +		int is_rdp=0;
    1.16  		int j;
    1.17  		int k;
    1.18  		char *default_device_name="Pointing device xx";
    1.19 @@ -110,7 +112,6 @@
    1.20  		{
    1.21  			continue;
    1.22  		}
    1.23 -
    1.24  		buffer+=4;
    1.25  		tmp-=4;
    1.26  
    1.27 @@ -132,6 +133,35 @@
    1.28  	SDL_memcpy(key_name, reg_key_root, SDL_strlen (reg_key_root));
    1.29      SDL_memcpy(key_name + (SDL_strlen (reg_key_root)), buffer, j + 1);
    1.30      
    1.31 +	l=SDL_strlen(key_name);
    1.32 +	is_rdp=0;
    1.33 +	if(l>=7)
    1.34 +	{
    1.35 +		for(j=0;j<l-7;++j)
    1.36 +		{
    1.37 +			for(k=0;k<7;++k)
    1.38 +			{
    1.39 +				if(rdp[k]!=SDL_tolower((unsigned char)key_name[j+k]))
    1.40 +				{
    1.41 +					break;
    1.42 +				}
    1.43 +			}
    1.44 +			if(k==7)
    1.45 +			{
    1.46 +				is_rdp=1;
    1.47 +				break;
    1.48 +			}
    1.49 +		}
    1.50 +	}
    1.51 +	if(is_rdp==1)
    1.52 +	{
    1.53 +		SDL_free(buffer);
    1.54 +		SDL_free(key_name);
    1.55 +		SDL_free(device_name);
    1.56 +		is_rdp=0;
    1.57 +		continue;
    1.58 +	}
    1.59 +	
    1.60  	/*we're opening the registry key to get the mouse name*/
    1.61  
    1.62  	rc = RegOpenKeyExA(HKEY_LOCAL_MACHINE, key_name, 0, KEY_READ, &hkey);
    1.63 @@ -197,7 +227,6 @@
    1.64  void
    1.65  WIN_QuitMouse(_THIS)
    1.66  {
    1.67 -	int i;
    1.68      SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    1.69  	/*let's delete all of the mouses*/
    1.70  	SDL_MouseQuit();
     2.1 --- a/src/video/win32/SDL_win32window.c	Wed Aug 06 11:49:28 2008 +0000
     2.2 +++ b/src/video/win32/SDL_win32window.c	Thu Aug 14 08:28:19 2008 +0000
     2.3 @@ -39,7 +39,7 @@
     2.4  
     2.5  #include <wintab.h>
     2.6  /*we're telling wintab that we want to receive movement, button events and pressure information in packets*/
     2.7 -#define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE)
     2.8 +#define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR)
     2.9  #define PACKETMODE 0
    2.10  #include <pktdef.h>
    2.11