comparison src/video/windib/SDL_dibevents.c @ 3868:b2f59aadec0d SDL-1.2

Fixed bug #294 Can't build SDL 1.2.11(and svn) for Pocket PC 2003 with Visual Studio 2005 Fix contributed by Dmitry Yakimov
author Sam Lantinga <slouken@libsdl.org>
date Sat, 23 Sep 2006 23:07:52 +0000
parents eb2d5480ae95
children b0d021cf41b6
comparison
equal deleted inserted replaced
3867:4dae257a9cbf 3868:b2f59aadec0d
271 static HKL hLayoutUS = NULL; 271 static HKL hLayoutUS = NULL;
272 272
273 void DIB_InitOSKeymap(_THIS) 273 void DIB_InitOSKeymap(_THIS)
274 { 274 {
275 int i; 275 int i;
276 char current_layout[256]; 276 #ifndef _WIN32_WCE
277 char current_layout[KL_NAMELENGTH];
277 278
278 GetKeyboardLayoutName(current_layout); 279 GetKeyboardLayoutName(current_layout);
279 //printf("Initial Keyboard Layout Name: '%s'\n", current_layout); 280 //printf("Initial Keyboard Layout Name: '%s'\n", current_layout);
280 281
281 hLayoutUS = LoadKeyboardLayout("00000409", KLF_NOTELLSHELL); 282 hLayoutUS = LoadKeyboardLayout("00000409", KLF_NOTELLSHELL);
283
282 if (!hLayoutUS) { 284 if (!hLayoutUS) {
283 //printf("Failed to load US keyboard layout. Using current.\n"); 285 //printf("Failed to load US keyboard layout. Using current.\n");
284 hLayoutUS = GetKeyboardLayout(0); 286 hLayoutUS = GetKeyboardLayout(0);
285 } 287 }
286 LoadKeyboardLayout(current_layout, KLF_ACTIVATE); 288 LoadKeyboardLayout(current_layout, KLF_ACTIVATE);
287 289 #else
290 #if _WIN32_WCE >=420
291 TCHAR current_layout[KL_NAMELENGTH];
292
293 GetKeyboardLayoutName(current_layout);
294 //printf("Initial Keyboard Layout Name: '%s'\n", current_layout);
295
296 hLayoutUS = LoadKeyboardLayout(L"00000409", 0);
297
298 if (!hLayoutUS) {
299 //printf("Failed to load US keyboard layout. Using current.\n");
300 hLayoutUS = GetKeyboardLayout(0);
301 }
302 LoadKeyboardLayout(current_layout, 0);
303 #endif // _WIN32_WCE >=420
304 #endif
288 /* Map the VK keysyms */ 305 /* Map the VK keysyms */
289 for ( i=0; i<SDL_arraysize(VK_keymap); ++i ) 306 for ( i=0; i<SDL_arraysize(VK_keymap); ++i )
290 VK_keymap[i] = SDLK_UNKNOWN; 307 VK_keymap[i] = SDLK_UNKNOWN;
291 308
292 VK_keymap[VK_BACK] = SDLK_BACKSPACE; 309 VK_keymap[VK_BACK] = SDLK_BACKSPACE;
412 429
413 #define EXTKEYPAD(keypad) ((scancode & 0x100)?(mvke):(keypad)) 430 #define EXTKEYPAD(keypad) ((scancode & 0x100)?(mvke):(keypad))
414 431
415 static int SDL_MapVirtualKey(int scancode, int vkey) 432 static int SDL_MapVirtualKey(int scancode, int vkey)
416 { 433 {
434 #ifndef _WIN32_WCE
417 int mvke = MapVirtualKeyEx(scancode & 0xFF, 1, hLayoutUS); 435 int mvke = MapVirtualKeyEx(scancode & 0xFF, 1, hLayoutUS);
436 #else
437 int mvke = MapVirtualKey(scancode & 0xFF, 1);
438 #endif
418 439
419 switch(vkey) { 440 switch(vkey) {
420 /* These are always correct */ 441 /* These are always correct */
421 case VK_DIVIDE: 442 case VK_DIVIDE:
422 case VK_MULTIPLY: 443 case VK_MULTIPLY: