comparison src/video/win32/SDL_win32events.c @ 4694:c24ba2cc9583

Merged Jim's Google Summer of Code work from SDL-gsoc2010_gesture
author Sam Lantinga <slouken@libsdl.org>
date Sun, 22 Aug 2010 12:07:55 -0700
parents e1664f94f026 03dcb795c583
children 518d1679d2d0
comparison
equal deleted inserted replaced
4638:08d22c54a21f 4694:c24ba2cc9583
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
119 /* Get the window data for the window */ 122 /* Get the window data for the window */
120 data = (SDL_WindowData *) GetProp(hwnd, TEXT("SDL_WindowData")); 123 data = (SDL_WindowData *) GetProp(hwnd, TEXT("SDL_WindowData"));
121 if (!data) { 124 if (!data) {
122 return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam); 125 return CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam);
123 } 126 }
127
124 #ifdef WMMSG_DEBUG 128 #ifdef WMMSG_DEBUG
125 { 129 {
126 FILE *log = fopen("wmmsg.txt", "a"); 130 FILE *log = fopen("wmmsg.txt", "a");
127 fprintf(log, "Received windows message: %p ", hwnd); 131 fprintf(log, "Received windows message: %p ", hwnd);
128 if (msg > MAX_WMMSG) { 132 if (msg > MAX_WMMSG) {
129 fprintf(log, "%d", msg); 133 fprintf(log, "%d", msg);
130 } else { 134 } else {
131 fprintf(log, "%s", wmtab[msg]); 135 fprintf(log, "%s", wmtab[msg]);
507 { 511 {
508 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0); 512 SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0);
509 } 513 }
510 returnCode = 0; 514 returnCode = 0;
511 break; 515 break;
512 } 516 case WM_TOUCH:
517 {
518 //printf("Got Touch Event!\n");
519
520 FILE *log = fopen("wmmsg.txt", "a");
521 fprintf(log, "Received Touch Message: %p ", hwnd);
522 if (msg > MAX_WMMSG) {
523 fprintf(log, "%d", msg);
524 } else {
525 fprintf(log, "%s", wmtab[msg]);
526 }
527 fprintf(log, "WM_TOUCH = %d -- 0x%X, 0x%X\n",msg, wParam, lParam);
528 fclose(log);
529
530 }
531 break;
532 case WM_GESTURE:
533 {
534 //printf("Got Touch Event!\n");
535
536 FILE *log = fopen("wmmsg.txt", "a");
537 fprintf(log, "Received Gesture Message: %p ", hwnd);
538 if (msg > MAX_WMMSG) {
539 fprintf(log, "%d", msg);
540 } else {
541 fprintf(log, "%s", wmtab[msg]);
542 }
543 fprintf(log, "WM_GESTURE = %d -- 0x%X, 0x%X\n",msg, wParam, lParam);
544 fclose(log);
545
546 }
547 break;
548 }
513 549
514 /* If there's a window proc, assume it's going to handle messages */ 550 /* If there's a window proc, assume it's going to handle messages */
515 if (data->wndproc) { 551 if (data->wndproc) {
516 return CallWindowProc(data->wndproc, hwnd, msg, wParam, lParam); 552 return CallWindowProc(data->wndproc, hwnd, msg, wParam, lParam);
517 } else if (returnCode >= 0) { 553 } else if (returnCode >= 0) {