comparison src/video/win32/SDL_win32events.c @ 2724:0e2b65f32298

Added Wacom API headers. FIXME: Dynamically load the Wacom API functions from wintab32.dll
author Sam Lantinga <slouken@libsdl.org>
date Tue, 26 Aug 2008 05:26:28 +0000
parents 62e7af9b2b67
children f23ebf1ddac4
comparison
equal deleted inserted replaced
2723:911db724ea24 2724:0e2b65f32298
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
35 #include <wintab.h>
36 #define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR)
37 #define PACKETMODE 0
38 #include <pktdef.h>
39 34
40 /*#define WMMSG_DEBUG*/ 35 /*#define WMMSG_DEBUG*/
41 #ifdef WMMSG_DEBUG 36 #ifdef WMMSG_DEBUG
42 #include <stdio.h> 37 #include <stdio.h>
43 #include "wmmsg.h" 38 #include "wmmsg.h"
150 145
151 case WT_PROXIMITY: 146 case WT_PROXIMITY:
152 { 147 {
153 /* checking where the proximity message showed up */ 148 /* checking where the proximity message showed up */
154 int h_context = LOWORD(lParam); 149 int h_context = LOWORD(lParam);
155 LPPOINT point; 150 POINT point;
156 GetCursorPos(&point); 151 GetCursorPos(&point);
157 ScreenToClient(hwnd, &point); 152 ScreenToClient(hwnd, &point);
158 153
159 /* are we in proximity or out of proximity */ 154 /* are we in proximity or out of proximity */
160 if (h_context == 0) { 155 if (h_context == 0) {
161 SDL_SendProximity(tablet, (int) (&point->x), 156 SDL_SendProximity(tablet, point.x, point.y, SDL_PROXIMITYOUT);
162 (int) (&point->y), SDL_PROXIMITYOUT);
163 } else { 157 } else {
164 SDL_SendProximity(tablet, (int) (&point->x), 158 SDL_SendProximity(tablet, point.x, point.y, SDL_PROXIMITYIN);
165 (int) (&point->y), SDL_PROXIMITYIN);
166 } 159 }
167 } 160 }
168 break; 161 break;
169 162
170 case WM_SHOWWINDOW: 163 case WM_SHOWWINDOW:
220 const RAWINPUTHEADER *header; 213 const RAWINPUTHEADER *header;
221 int index; 214 int index;
222 int i; 215 int i;
223 int size = 0; 216 int size = 0;
224 const RAWMOUSE *raw_mouse = NULL; 217 const RAWMOUSE *raw_mouse = NULL;
225 LPPOINT point; 218 POINT point;
226 USHORT flags; 219 USHORT flags;
227 220
228 /* we're collecting data from the mouse */ 221 /* we're collecting data from the mouse */
229 GetRawInputData((HRAWINPUT) lParam, RID_INPUT, NULL, &size, 222 GetRawInputData((HRAWINPUT) lParam, RID_INPUT, NULL, &size,
230 sizeof(RAWINPUTHEADER)); 223 sizeof(RAWINPUTHEADER));
247 SDL_GetWindowSize(data->windowID, &w, &h); 240 SDL_GetWindowSize(data->windowID, &w, &h);
248 SDL_UpdateCoordinates(w, h); /* we're updating the current window size */ 241 SDL_UpdateCoordinates(w, h); /* we're updating the current window size */
249 242
250 /* if the message was sent by a tablet we have to send also pressure */ 243 /* if the message was sent by a tablet we have to send also pressure */
251 if (i == tablet) { 244 if (i == tablet) {
252 SDL_SendMouseMotion(index, 0, (int) (&point->x), 245 SDL_SendMouseMotion(index, 0, point.x, point.y, pressure);
253 (int) (&point->y), pressure);
254 } else { 246 } else {
255 SDL_SendMouseMotion(index, 0, (int) (&point->x), 247 SDL_SendMouseMotion(index, 0, point.x, point.y, 0);
256 (int) (&point->y), 0);
257 } 248 }
258 /* we're sending mouse buttons messages to check up if sth changed */ 249 /* we're sending mouse buttons messages to check up if sth changed */
259 if (flags & RI_MOUSE_BUTTON_1_DOWN) { 250 if (flags & RI_MOUSE_BUTTON_1_DOWN) {
260 SDL_SendMouseButton(index, SDL_PRESSED, SDL_BUTTON_LEFT); 251 SDL_SendMouseButton(index, SDL_PRESSED, SDL_BUTTON_LEFT);
261 } else if (flags & RI_MOUSE_BUTTON_1_UP) { 252 } else if (flags & RI_MOUSE_BUTTON_1_UP) {