Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_win32events.c @ 4650:7ad7a473b086
More fixes for windows. Disabled tablet code.
author | jimtla |
---|---|
date | Thu, 10 Jun 2010 00:15:17 -0400 |
parents | faa9fc8e7f67 |
children | 03dcb795c583 |
comparison
equal
deleted
inserted
replaced
4649:35a80b0791aa | 4650:7ad7a473b086 |
---|---|
18 | 18 |
19 Sam Lantinga | 19 Sam Lantinga |
20 slouken@libsdl.org | 20 slouken@libsdl.org |
21 */ | 21 */ |
22 | 22 |
23 #if (_WIN32_WINNT < 0x0501) | 23 #if (_WIN32_WINNT < 0x601) |
24 #undef _WIN32_WINNT | 24 #undef _WIN32_WINNT |
25 #define _WIN32_WINNT 0x0501 | 25 #define _WIN32_WINNT 0x601 |
26 #endif | 26 #endif |
27 | 27 |
28 #include "SDL_config.h" | 28 #include "SDL_config.h" |
29 | 29 |
30 #include "SDL_win32video.h" | 30 #include "SDL_win32video.h" |
31 #include "SDL_syswm.h" | 31 #include "SDL_syswm.h" |
32 #include "SDL_vkeys.h" | 32 #include "SDL_vkeys.h" |
33 #include "../../events/SDL_events_c.h" | 33 #include "../../events/SDL_events_c.h" |
34 | 34 |
35 /*#define WMMSG_DEBUG*/ | 35 |
36 | |
37 #define WMMSG_DEBUG | |
36 #ifdef WMMSG_DEBUG | 38 #ifdef WMMSG_DEBUG |
37 #include <stdio.h> | 39 #include <stdio.h> |
38 #include "wmmsg.h" | 40 #include "wmmsg.h" |
39 #endif | 41 #endif |
42 //#include <stdio.h> | |
40 | 43 |
41 /* Masks for processing the windows KEYDOWN and KEYUP messages */ | 44 /* Masks for processing the windows KEYDOWN and KEYUP messages */ |
42 #define REPEATED_KEYMASK (1<<30) | 45 #define REPEATED_KEYMASK (1<<30) |
43 #define EXTENDED_KEYMASK (1<<24) | 46 #define EXTENDED_KEYMASK (1<<24) |
44 | 47 |
123 /* Get the window data for the window */ | 126 /* Get the window data for the window */ |
124 data = (SDL_WindowData *) GetProp(hwnd, TEXT("SDL_WindowData")); | 127 data = (SDL_WindowData *) GetProp(hwnd, TEXT("SDL_WindowData")); |
125 if (!data) { | 128 if (!data) { |
126 return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam); | 129 return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam); |
127 } | 130 } |
131 | |
128 #ifdef WMMSG_DEBUG | 132 #ifdef WMMSG_DEBUG |
129 { | 133 { |
130 FILE *log = fopen("wmmsg.txt", "a"); | 134 FILE *log = fopen("wmmsg.txt", "a"); |
131 fprintf(log, "Received windows message: %p ", hwnd); | 135 fprintf(log, "Received windows message: %p ", hwnd); |
132 if (msg > MAX_WMMSG) { | 136 if (msg > MAX_WMMSG) { |
133 fprintf(log, "%d", msg); | 137 fprintf(log, "%d", msg); |
134 } else { | 138 } else { |
135 fprintf(log, "%s", wmtab[msg]); | 139 fprintf(log, "%s", wmtab[msg]); |
641 { | 645 { |
642 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); | 646 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); |
643 } | 647 } |
644 returnCode = 0; | 648 returnCode = 0; |
645 break; | 649 break; |
646 } | 650 case WM_TOUCH: |
651 { | |
652 //printf("Got Touch Event!\n"); | |
653 | |
654 FILE *log = fopen("wmmsg.txt", "a"); | |
655 fprintf(log, "Received Touch Message: %p ", hwnd); | |
656 if (msg > MAX_WMMSG) { | |
657 fprintf(log, "%d", msg); | |
658 } else { | |
659 fprintf(log, "%s", wmtab[msg]); | |
660 } | |
661 fprintf(log, "WM_TOUCH = %d -- 0x%X, 0x%X\n",msg, wParam, lParam); | |
662 fclose(log); | |
663 | |
664 } | |
665 break; | |
666 case WM_GESTURE: | |
667 { | |
668 //printf("Got Touch Event!\n"); | |
669 | |
670 FILE *log = fopen("wmmsg.txt", "a"); | |
671 fprintf(log, "Received Gesture Message: %p ", hwnd); | |
672 if (msg > MAX_WMMSG) { | |
673 fprintf(log, "%d", msg); | |
674 } else { | |
675 fprintf(log, "%s", wmtab[msg]); | |
676 } | |
677 fprintf(log, "WM_GESTURE = %d -- 0x%X, 0x%X\n",msg, wParam, lParam); | |
678 fclose(log); | |
679 | |
680 } | |
681 break; | |
682 } | |
647 | 683 |
648 /* If there's a window proc, assume it's going to handle messages */ | 684 /* If there's a window proc, assume it's going to handle messages */ |
649 if (data->wndproc) { | 685 if (data->wndproc) { |
650 return CallWindowProc(data->wndproc, hwnd, msg, wParam, lParam); | 686 return CallWindowProc(data->wndproc, hwnd, msg, wParam, lParam); |
651 } else if (returnCode >= 0) { | 687 } else if (returnCode >= 0) { |