Navigation Menu

Skip to content

Commit

Permalink
Fixed bug #304
Browse files Browse the repository at this point in the history
WinCE - refactoring of hardware buttons handling
Contributed by Dmitry Yakimov
  • Loading branch information
slouken committed Sep 23, 2006
1 parent 5496f1a commit e59f46f
Showing 1 changed file with 2 additions and 33 deletions.
35 changes: 2 additions & 33 deletions src/video/wincommon/SDL_syswm.c
Expand Up @@ -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.
Expand Down Expand Up @@ -263,13 +244,7 @@ SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode)
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);
Expand All @@ -284,13 +259,7 @@ SDL_GrabMode WIN_GrabInput(_THIS, SDL_GrabMode mode)
SetCursorPos(pt.x, pt.y);
}
#ifdef _WIN32_WCE
if( !input_catched )
{
if( !CoreCatchInput ) LoadInputCatchFunc();

if( CoreCatchInput )
CoreCatchInput(1);
}
AllKeys(1);
#endif
}
return(mode);
Expand Down

0 comments on commit e59f46f

Please sign in to comment.