comparison src/video/windib/SDL_dibevents.c @ 1472:4aac8563c296

Fixed more Win64 portability issues
author Sam Lantinga <slouken@libsdl.org>
date Mon, 06 Mar 2006 08:11:10 +0000
parents 84de7511f79f
children 0a2bd6507477
comparison
equal deleted inserted replaced
1471:9fb0eee04dd9 1472:4aac8563c296
41 #define NO_GETKEYBOARDSTATE 41 #define NO_GETKEYBOARDSTATE
42 #endif 42 #endif
43 43
44 /* The translation table from a Microsoft VK keysym to a SDL keysym */ 44 /* The translation table from a Microsoft VK keysym to a SDL keysym */
45 static SDLKey VK_keymap[SDLK_LAST]; 45 static SDLKey VK_keymap[SDLK_LAST];
46 static SDL_keysym *TranslateKey(UINT vkey, UINT scancode, SDL_keysym *keysym, int pressed); 46 static SDL_keysym *TranslateKey(WPARAM vkey, UINT scancode, SDL_keysym *keysym, int pressed);
47 47
48 /* Masks for processing the windows KEYDOWN and KEYUP messages */ 48 /* Masks for processing the windows KEYDOWN and KEYUP messages */
49 #define REPEATED_KEYMASK (1<<30) 49 #define REPEATED_KEYMASK (1<<30)
50 #define EXTENDED_KEYMASK (1<<24) 50 #define EXTENDED_KEYMASK (1<<24)
51 51
374 VK_keymap[VK_SNAPSHOT] = SDLK_PRINT; 374 VK_keymap[VK_SNAPSHOT] = SDLK_PRINT;
375 VK_keymap[VK_CANCEL] = SDLK_BREAK; 375 VK_keymap[VK_CANCEL] = SDLK_BREAK;
376 VK_keymap[VK_APPS] = SDLK_MENU; 376 VK_keymap[VK_APPS] = SDLK_MENU;
377 } 377 }
378 378
379 static SDL_keysym *TranslateKey(UINT vkey, UINT scancode, SDL_keysym *keysym, int pressed) 379 static SDL_keysym *TranslateKey(WPARAM vkey, UINT scancode, SDL_keysym *keysym, int pressed)
380 { 380 {
381 /* Set the keysym information */ 381 /* Set the keysym information */
382 keysym->scancode = (unsigned char) scancode; 382 keysym->scancode = (unsigned char) scancode;
383 keysym->sym = VK_keymap[vkey]; 383 keysym->sym = VK_keymap[vkey];
384 keysym->mod = KMOD_NONE; 384 keysym->mod = KMOD_NONE;
424 } 424 }
425 425
426 /* DJM: we want all event's for the user specified 426 /* DJM: we want all event's for the user specified
427 window to be handled by SDL. 427 window to be handled by SDL.
428 */ 428 */
429 userWindowProc = (WNDPROCTYPE)GetWindowLongPtr(SDL_Window, GWL_WNDPROC); 429 userWindowProc = (WNDPROCTYPE)GetWindowLongPtr(SDL_Window, GWLP_WNDPROC);
430 SetWindowLongPtr(SDL_Window, GWL_WNDPROC, (LONG_PTR)WinMessage); 430 SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)WinMessage);
431 } else { 431 } else {
432 SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, 432 SDL_Window = CreateWindow(SDL_Appname, SDL_Appname,
433 (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX), 433 (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX),
434 CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, SDL_Instance, NULL); 434 CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, SDL_Instance, NULL);
435 if ( SDL_Window == NULL ) { 435 if ( SDL_Window == NULL ) {
442 } 442 }
443 443
444 void DIB_DestroyWindow(_THIS) 444 void DIB_DestroyWindow(_THIS)
445 { 445 {
446 if ( SDL_windowid ) { 446 if ( SDL_windowid ) {
447 SetWindowLongPtr(SDL_Window, GWL_WNDPROC, (LONG_PTR)userWindowProc); 447 SetWindowLongPtr(SDL_Window, GWLP_WNDPROC, (LONG_PTR)userWindowProc);
448 } else { 448 } else {
449 DestroyWindow(SDL_Window); 449 DestroyWindow(SDL_Window);
450 } 450 }
451 SDL_UnregisterApp(); 451 SDL_UnregisterApp();
452 } 452 }