comparison src/video/win32/SDL_win32mouse.c @ 2940:b93965a16fe0

Fixed X11 mouse motion/button events - it's not actually safe to cast mouse events to device events. Fixed building SDL without XInput support Simplified the process of registering a mouse device
author Sam Lantinga <slouken@libsdl.org>
date Thu, 01 Jan 2009 07:59:08 +0000
parents 99210400e8b9
children d2f68ec8c1d0
comparison
equal deleted inserted replaced
2939:084e5b4fc5be 2940:b93965a16fe0
148 } 148 }
149 149
150 /* we're saving the handle to the device */ 150 /* we're saving the handle to the device */
151 mice[index] = deviceList[i].hDevice; 151 mice[index] = deviceList[i].hDevice;
152 SDL_zero(mouse); 152 SDL_zero(mouse);
153 SDL_SetMouseIndexId(index, index); 153 mouse.id = index;
154 l = SDL_strlen(device_name); 154 l = SDL_strlen(device_name);
155 155
156 /* we're checking if the device isn't by any chance a tablet */ 156 /* we're checking if the device isn't by any chance a tablet */
157 if (data->wintabDLL && tablet == -1) { 157 if (data->wintabDLL && tablet == -1) {
158 for (j = 0; j < l - 5; ++j) { 158 for (j = 0; j < l - 5; ++j) {
174 AXIS pressure; 174 AXIS pressure;
175 int cursors; 175 int cursors;
176 data->WTInfoA(WTI_DEVICES, DVC_NPRESSURE, &pressure); 176 data->WTInfoA(WTI_DEVICES, DVC_NPRESSURE, &pressure);
177 data->WTInfoA(WTI_DEVICES, DVC_NCSRTYPES, &cursors); 177 data->WTInfoA(WTI_DEVICES, DVC_NCSRTYPES, &cursors);
178 data->mouse = 178 data->mouse =
179 SDL_AddMouse(&mouse, index, device_name, pressure.axMax, 179 SDL_AddMouse(&mouse, device_name, pressure.axMax,
180 pressure.axMin, cursors); 180 pressure.axMin, cursors);
181 } else { 181 } else {
182 data->mouse = SDL_AddMouse(&mouse, index, device_name, 0, 0, 1); 182 data->mouse = SDL_AddMouse(&mouse, device_name, 0, 0, 1);
183 } 183 }
184 ++index; 184 ++index;
185 SDL_free(buffer); 185 SDL_free(buffer);
186 SDL_free(key_name); 186 SDL_free(key_name);
187 } 187 }