comparison src/video/wincommon/SDL_syswm.c @ 3869:b0955ae208f3 SDL-1.2

Fixed bug #304 WinCE - refactoring of hardware buttons handling Contributed by Dmitry Yakimov
author Sam Lantinga <slouken@libsdl.org>
date Sat, 23 Sep 2006 23:12:44 +0000
parents 720f8bb49d7d
children d13618a935a2
comparison
equal deleted inserted replaced
3868:b2f59aadec0d 3869:b0955ae208f3
38 #define DISABLE_ICON_SUPPORT 38 #define DISABLE_ICON_SUPPORT
39 #endif 39 #endif
40 40
41 /* The screen icon -- needs to be freed on SDL_VideoQuit() */ 41 /* The screen icon -- needs to be freed on SDL_VideoQuit() */
42 HICON screen_icn = NULL; 42 HICON screen_icn = NULL;
43
44 #ifdef _WIN32_WCE
45
46 BOOL (WINAPI *CoreCatchInput)(int flag) = NULL;
47 int input_catched = 0;
48 HINSTANCE coredll = NULL;
49
50 // the same API call that gx.dll does to catch the input
51 void LoadInputCatchFunc()
52 {
53 coredll = SDL_LoadObject("coredll.dll");
54 if( coredll )
55 {
56 CoreCatchInput = (int (WINAPI *)(int)) GetProcAddress(coredll, (const unsigned short *) 1453);
57 }
58 }
59
60 #endif
61
62 43
63 /* Win32 icon mask semantics are different from those of SDL: 44 /* Win32 icon mask semantics are different from those of SDL:
64 SDL applies the mask to the icon and copies result to desktop. 45 SDL applies the mask to the icon and copies result to desktop.
65 Win32 applies the mask to the desktop and XORs the icon on. 46 Win32 applies the mask to the desktop and XORs the icon on.
66 This means that the SDL mask needs to be applied to the icon and 47 This means that the SDL mask needs to be applied to the icon and
261 pt.y = y; 242 pt.y = y;
262 ClientToScreen(SDL_Window, &pt); 243 ClientToScreen(SDL_Window, &pt);
263 SetCursorPos(pt.x,pt.y); 244 SetCursorPos(pt.x,pt.y);
264 } 245 }
265 #ifdef _WIN32_WCE 246 #ifdef _WIN32_WCE
266 if( input_catched ) 247 AllKeys(0);
267 {
268 if( !CoreCatchInput ) LoadInputCatchFunc();
269
270 if( CoreCatchInput )
271 CoreCatchInput(0);
272 }
273 #endif 248 #endif
274 } else { 249 } else {
275 ClipCursor(&SDL_bounds); 250 ClipCursor(&SDL_bounds);
276 if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) { 251 if ( !(SDL_cursorstate & CURSOR_VISIBLE) ) {
277 /* RJR: March 28, 2000 252 /* RJR: March 28, 2000
282 pt.y = (SDL_VideoSurface->h/2); 257 pt.y = (SDL_VideoSurface->h/2);
283 ClientToScreen(SDL_Window, &pt); 258 ClientToScreen(SDL_Window, &pt);
284 SetCursorPos(pt.x, pt.y); 259 SetCursorPos(pt.x, pt.y);
285 } 260 }
286 #ifdef _WIN32_WCE 261 #ifdef _WIN32_WCE
287 if( !input_catched ) 262 AllKeys(1);
288 {
289 if( !CoreCatchInput ) LoadInputCatchFunc();
290
291 if( CoreCatchInput )
292 CoreCatchInput(1);
293 }
294 #endif 263 #endif
295 } 264 }
296 return(mode); 265 return(mode);
297 } 266 }
298 267