Commit 66bd610f authored by Sam Lantinga's avatar Sam Lantinga

Fixed bug #304

WinCE - refactoring of hardware buttons handling
Contributed by Dmitry Yakimov

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402103
parent a7123784
...@@ -41,25 +41,6 @@ ...@@ -41,25 +41,6 @@
/* The screen icon -- needs to be freed on SDL_VideoQuit() */ /* The screen icon -- needs to be freed on SDL_VideoQuit() */
HICON screen_icn = NULL; 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: /* Win32 icon mask semantics are different from those of SDL:
SDL applies the mask to the icon and copies result to desktop. SDL applies the mask to the icon and copies result to desktop.
Win32 applies the mask to the desktop and XORs the icon on. Win32 applies the mask to the desktop and XORs the icon on.
...@@ -263,13 +244,7 @@ SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode) ...@@ -263,13 +244,7 @@ SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode)
SetCursorPos(pt.x,pt.y); SetCursorPos(pt.x,pt.y);
} }
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
if( input_catched ) AllKeys(0);
{
if( !CoreCatchInput ) LoadInputCatchFunc();
if( CoreCatchInput )
CoreCatchInput(0);
}
#endif #endif
} else { } else {
ClipCursor(&SDL_bounds); ClipCursor(&SDL_bounds);
...@@ -284,13 +259,7 @@ SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode) ...@@ -284,13 +259,7 @@ SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode)
SetCursorPos(pt.x, pt.y); SetCursorPos(pt.x, pt.y);
} }
#ifdef _WIN32_WCE #ifdef _WIN32_WCE
if( !input_catched ) AllKeys(1);
{
if( !CoreCatchInput ) LoadInputCatchFunc();
if( CoreCatchInput )
CoreCatchInput(1);
}
#endif #endif
} }
return(mode); return(mode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment