comparison src/video/win32/SDL_win32events.c @ 2324:3202e4826c57

more valgrind errors fixed. Plus I ran make indent which changed a few files.
author Bob Pendleton <bob@pendleton.com>
date Fri, 07 Mar 2008 17:20:37 +0000
parents f537a293b3da
children 44e49d3fa6cf abc8acb8e3d7
comparison
equal deleted inserted replaced
2323:4ac07ae446d3 2324:3202e4826c57
34 34
35 /* Masks for processing the windows KEYDOWN and KEYUP messages */ 35 /* Masks for processing the windows KEYDOWN and KEYUP messages */
36 #define REPEATED_KEYMASK (1<<30) 36 #define REPEATED_KEYMASK (1<<30)
37 #define EXTENDED_KEYMASK (1<<24) 37 #define EXTENDED_KEYMASK (1<<24)
38 38
39 #define VK_ENTER 10 /* Keypad Enter ... no VKEY defined? */ 39 #define VK_ENTER 10 /* Keypad Enter ... no VKEY defined? */
40 40
41 /* Make sure XBUTTON stuff is defined that isn't in older Platform SDKs... */ 41 /* Make sure XBUTTON stuff is defined that isn't in older Platform SDKs... */
42 #ifndef WM_XBUTTONDOWN 42 #ifndef WM_XBUTTONDOWN
43 #define WM_XBUTTONDOWN 0x020B 43 #define WM_XBUTTONDOWN 0x020B
44 #endif 44 #endif
51 51
52 static WPARAM 52 static WPARAM
53 RemapVKEY(WPARAM wParam, LPARAM lParam) 53 RemapVKEY(WPARAM wParam, LPARAM lParam)
54 { 54 {
55 int i; 55 int i;
56 BYTE scancode = (BYTE)((lParam >> 16) & 0xFF); 56 BYTE scancode = (BYTE) ((lParam >> 16) & 0xFF);
57 57
58 /* Windows remaps alphabetic keys based on current layout. 58 /* Windows remaps alphabetic keys based on current layout.
59 We try to provide USB scancodes, so undo this mapping. 59 We try to provide USB scancodes, so undo this mapping.
60 */ 60 */
61 if (wParam >= 'A' && wParam <= 'Z') { 61 if (wParam >= 'A' && wParam <= 'Z') {
70 } 70 }
71 71
72 /* Keypad keys are a little trickier, we always scan for them. */ 72 /* Keypad keys are a little trickier, we always scan for them. */
73 for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) { 73 for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) {
74 if (scancode == keypad_scancodes[i]) { 74 if (scancode == keypad_scancodes[i]) {
75 wParam = VK_NUMPAD0+i; 75 wParam = VK_NUMPAD0 + i;
76 break; 76 break;
77 } 77 }
78 } 78 }
79 79
80 return wParam; 80 return wParam;