src/video/wincommon/SDL_syswm.c
changeset 1152 51a8702d8ecd
parent 439 3ac8344e3872
child 1312 c9b51268668f
     1.1 --- a/src/video/wincommon/SDL_syswm.c	Wed Sep 28 11:36:20 2005 +0000
     1.2 +++ b/src/video/wincommon/SDL_syswm.c	Thu Sep 29 09:43:00 2005 +0000
     1.3 @@ -36,6 +36,8 @@
     1.4  #include "SDL_syswm_c.h"
     1.5  #include "SDL_wingl_c.h"
     1.6  #include "SDL_pixels_c.h"
     1.7 +#include "SDL_loadso.h"
     1.8 +
     1.9  
    1.10  #ifdef _WIN32_WCE
    1.11  #define DISABLE_ICON_SUPPORT
    1.12 @@ -48,6 +50,25 @@
    1.13  /* The screen icon -- needs to be freed on SDL_VideoQuit() */
    1.14  HICON   screen_icn = NULL;
    1.15  
    1.16 +#ifdef _WIN32_WCE
    1.17 +
    1.18 +BOOL (WINAPI *CoreCatchInput)(int flag) = NULL;
    1.19 +int input_catched = 0;
    1.20 +HINSTANCE coredll = NULL;
    1.21 +
    1.22 +// the same API call that gx.dll does to catch the input
    1.23 +void LoadInputCatchFunc()
    1.24 +{
    1.25 +	coredll = SDL_LoadObject("coredll.dll");
    1.26 +	if( coredll )
    1.27 +	{
    1.28 +		CoreCatchInput = (int (WINAPI *)(int)) GetProcAddress(coredll, (const unsigned short *) 1453);
    1.29 +	}
    1.30 +}
    1.31 +
    1.32 +#endif
    1.33 +
    1.34 +
    1.35  /* Win32 icon mask semantics are different from those of SDL:
    1.36       SDL applies the mask to the icon and copies result to desktop.
    1.37       Win32 applies the mask to the desktop and XORs the icon on.
    1.38 @@ -245,6 +266,15 @@
    1.39  			ClientToScreen(SDL_Window, &pt);
    1.40  			SetCursorPos(pt.x,pt.y);
    1.41  		}
    1.42 +#ifdef _WIN32_WCE
    1.43 +		if( input_catched )
    1.44 +		{
    1.45 +			if( !CoreCatchInput ) LoadInputCatchFunc();
    1.46 +
    1.47 +			if( CoreCatchInput )
    1.48 +				CoreCatchInput(0);
    1.49 +		}
    1.50 +#endif
    1.51  	} else {
    1.52  		ClipCursor(&SDL_bounds);
    1.53  		if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
    1.54 @@ -257,6 +287,15 @@
    1.55  			ClientToScreen(SDL_Window, &pt);
    1.56  			SetCursorPos(pt.x, pt.y);
    1.57  		}
    1.58 +#ifdef _WIN32_WCE
    1.59 +		if( !input_catched )
    1.60 +		{
    1.61 +			if( !CoreCatchInput ) LoadInputCatchFunc();
    1.62 +
    1.63 +			if( CoreCatchInput )
    1.64 +				CoreCatchInput(1);
    1.65 +		}
    1.66 +#endif
    1.67  	}
    1.68  	return(mode);
    1.69  }