Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_win32events.c @ 4868:d6adaafcfb10
Fixed compiling with Visual Studio 2008
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 29 Aug 2010 14:22:22 -0700 |
parents | 7b1d35d98294 |
children | 69d9db65f248 |
comparison
equal
deleted
inserted
replaced
4867:ba7492f9e2b8 | 4868:d6adaafcfb10 |
---|---|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
18 | 18 |
19 Sam Lantinga | 19 Sam Lantinga |
20 slouken@libsdl.org | 20 slouken@libsdl.org |
21 */ | 21 */ |
22 | |
23 #if (_WIN32_WINNT < 0x601) | |
24 #undef _WIN32_WINNT | |
25 #define _WIN32_WINNT 0x601 | |
26 #endif | |
27 | 22 |
28 #include "SDL_config.h" | 23 #include "SDL_config.h" |
29 | 24 |
30 #include "SDL_win32video.h" | 25 #include "SDL_win32video.h" |
31 #include "SDL_win32shape.h" | 26 #include "SDL_win32shape.h" |
33 #include "SDL_vkeys.h" | 28 #include "SDL_vkeys.h" |
34 #include "../../events/SDL_events_c.h" | 29 #include "../../events/SDL_events_c.h" |
35 | 30 |
36 | 31 |
37 | 32 |
38 #define WMMSG_DEBUG | 33 /*#define WMMSG_DEBUG*/ |
39 #ifdef WMMSG_DEBUG | 34 #ifdef WMMSG_DEBUG |
40 #include <stdio.h> | 35 #include <stdio.h> |
41 #include "wmmsg.h" | 36 #include "wmmsg.h" |
42 #endif | 37 #endif |
43 //#include <stdio.h> | |
44 | 38 |
45 /* Masks for processing the windows KEYDOWN and KEYUP messages */ | 39 /* Masks for processing the windows KEYDOWN and KEYUP messages */ |
46 #define REPEATED_KEYMASK (1<<30) | 40 #define REPEATED_KEYMASK (1<<30) |
47 #define EXTENDED_KEYMASK (1<<24) | 41 #define EXTENDED_KEYMASK (1<<24) |
48 | 42 |
58 #ifndef GET_XBUTTON_WPARAM | 52 #ifndef GET_XBUTTON_WPARAM |
59 #define GET_XBUTTON_WPARAM(w) (HIWORD(w)) | 53 #define GET_XBUTTON_WPARAM(w) (HIWORD(w)) |
60 #endif | 54 #endif |
61 #ifndef WM_INPUT | 55 #ifndef WM_INPUT |
62 #define WM_INPUT 0x00ff | 56 #define WM_INPUT 0x00ff |
57 #endif | |
58 #ifndef WM_GESTURE | |
59 #define WM_GESTURE 0x0119 | |
60 #endif | |
61 #ifndef WM_TOUCH | |
62 #define WM_TOUCH 0x0240 | |
63 #endif | 63 #endif |
64 | 64 |
65 static WPARAM | 65 static WPARAM |
66 RemapVKEY(WPARAM wParam, LPARAM lParam) | 66 RemapVKEY(WPARAM wParam, LPARAM lParam) |
67 { | 67 { |
136 fprintf(log, "%s", wmtab[msg]); | 136 fprintf(log, "%s", wmtab[msg]); |
137 } | 137 } |
138 fprintf(log, " -- 0x%X, 0x%X\n", wParam, lParam); | 138 fprintf(log, " -- 0x%X, 0x%X\n", wParam, lParam); |
139 fclose(log); | 139 fclose(log); |
140 } | 140 } |
141 | 141 #endif |
142 #endif | 142 |
143 if (IME_HandleMessage(hwnd, msg, wParam, &lParam, data->videodata)) | 143 if (IME_HandleMessage(hwnd, msg, wParam, &lParam, data->videodata)) |
144 return 0; | 144 return 0; |
145 | 145 |
146 switch (msg) { | 146 switch (msg) { |
147 | 147 |
520 break; | 520 break; |
521 case WM_TOUCH: | 521 case WM_TOUCH: |
522 { | 522 { |
523 //printf("Got Touch Event!\n"); | 523 //printf("Got Touch Event!\n"); |
524 | 524 |
525 #ifdef WMMSG_DEBUG | |
525 FILE *log = fopen("wmmsg.txt", "a"); | 526 FILE *log = fopen("wmmsg.txt", "a"); |
526 fprintf(log, "Received Touch Message: %p ", hwnd); | 527 fprintf(log, "Received Touch Message: %p ", hwnd); |
527 if (msg > MAX_WMMSG) { | 528 if (msg > MAX_WMMSG) { |
528 fprintf(log, "%d", msg); | 529 fprintf(log, "%d", msg); |
529 } else { | 530 } else { |
530 fprintf(log, "%s", wmtab[msg]); | 531 fprintf(log, "%s", wmtab[msg]); |
531 } | 532 } |
532 fprintf(log, "WM_TOUCH = %d -- 0x%X, 0x%X\n",msg, wParam, lParam); | 533 fprintf(log, "WM_TOUCH = %d -- 0x%X, 0x%X\n",msg, wParam, lParam); |
533 fclose(log); | 534 fclose(log); |
535 #endif | |
534 | 536 |
535 } | 537 } |
536 break; | 538 break; |
537 case WM_GESTURE: | 539 case WM_GESTURE: |
538 { | 540 { |
539 //printf("Got Touch Event!\n"); | 541 //printf("Got Touch Event!\n"); |
540 | 542 |
543 #ifdef WMMSG_DEBUG | |
541 FILE *log = fopen("wmmsg.txt", "a"); | 544 FILE *log = fopen("wmmsg.txt", "a"); |
542 fprintf(log, "Received Gesture Message: %p ", hwnd); | 545 fprintf(log, "Received Gesture Message: %p ", hwnd); |
543 if (msg > MAX_WMMSG) { | 546 if (msg > MAX_WMMSG) { |
544 fprintf(log, "%d", msg); | 547 fprintf(log, "%d", msg); |
545 } else { | 548 } else { |
546 fprintf(log, "%s", wmtab[msg]); | 549 fprintf(log, "%s", wmtab[msg]); |
547 } | 550 } |
548 fprintf(log, "WM_GESTURE = %d -- 0x%X, 0x%X\n",msg, wParam, lParam); | 551 fprintf(log, "WM_GESTURE = %d -- 0x%X, 0x%X\n",msg, wParam, lParam); |
549 fclose(log); | 552 fclose(log); |
550 | 553 #endif |
551 } | 554 } |
552 break; | 555 break; |
553 } | 556 } |
554 | 557 |
555 /* If there's a window proc, assume it's going to handle messages */ | 558 /* If there's a window proc, assume it's going to handle messages */ |