Fixed bug #304 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sat, 23 Sep 2006 23:12:44 +0000
branchSDL-1.2
changeset 3869 b0955ae208f3
parent 3868 b2f59aadec0d
child 3870 571c75f3d093
Fixed bug #304 WinCE - refactoring of hardware buttons handling Contributed by Dmitry Yakimov
src/video/wincommon/SDL_syswm.c
--- a/src/video/wincommon/SDL_syswm.c	Sat Sep 23 23:07:52 2006 +0000
+++ b/src/video/wincommon/SDL_syswm.c	Sat Sep 23 23:12:44 2006 +0000
@@ -41,25 +41,6 @@
 /* The screen icon -- needs to be freed on SDL_VideoQuit() */
 HICON   screen_icn = NULL;
 
-#ifdef _WIN32_WCE
-
-BOOL (WINAPI *CoreCatchInput)(int flag) = NULL;
-int input_catched = 0;
-HINSTANCE coredll = NULL;
-
-// the same API call that gx.dll does to catch the input
-void LoadInputCatchFunc()
-{
-	coredll = SDL_LoadObject("coredll.dll");
-	if( coredll )
-	{
-		CoreCatchInput = (int (WINAPI *)(int)) GetProcAddress(coredll, (const unsigned short *) 1453);
-	}
-}
-
-#endif
-
-
 /* Win32 icon mask semantics are different from those of SDL:
      SDL applies the mask to the icon and copies result to desktop.
      Win32 applies the mask to the desktop and XORs the icon on.
@@ -263,13 +244,7 @@
 			SetCursorPos(pt.x,pt.y);
 		}
 #ifdef _WIN32_WCE
-		if( input_catched )
-		{
-			if( !CoreCatchInput ) LoadInputCatchFunc();
-
-			if( CoreCatchInput )
-				CoreCatchInput(0);
-		}
+		AllKeys(0);
 #endif
 	} else {
 		ClipCursor(&SDL_bounds);
@@ -284,13 +259,7 @@
 			SetCursorPos(pt.x, pt.y);
 		}
 #ifdef _WIN32_WCE
-		if( !input_catched )
-		{
-			if( !CoreCatchInput ) LoadInputCatchFunc();
-
-			if( CoreCatchInput )
-				CoreCatchInput(1);
-		}
+		AllKeys(1);
 #endif
 	}
 	return(mode);