comparison src/video/x11/SDL_x11events.c @ 2942:1e431c2631ee

indent
author Sam Lantinga <slouken@libsdl.org>
date Thu, 01 Jan 2009 08:21:19 +0000
parents b93965a16fe0
children dbff5769d742
comparison
equal deleted inserted replaced
2941:1d2bc7259f30 2942:1e431c2631ee
295 SDL_SendMouseButton(0, SDL_RELEASED, xevent.xbutton.button); 295 SDL_SendMouseButton(0, SDL_RELEASED, xevent.xbutton.button);
296 break; 296 break;
297 297
298 default:{ 298 default:{
299 #if SDL_VIDEO_DRIVER_X11_XINPUT 299 #if SDL_VIDEO_DRIVER_X11_XINPUT
300 for (i = 0; i < SDL_GetNumMice(); ++i) { 300 for (i = 0; i < SDL_GetNumMice(); ++i) {
301 SDL_Mouse *mouse; 301 SDL_Mouse *mouse;
302 X11_MouseData *data; 302 X11_MouseData *data;
303 303
304 mouse = SDL_GetMouse(i); 304 mouse = SDL_GetMouse(i);
305 data = (X11_MouseData *)mouse->driverdata; 305 data = (X11_MouseData *) mouse->driverdata;
306 if (!data) { 306 if (!data) {
307 continue; 307 continue;
308 } 308 }
309 309
310 if (xevent.type == data->motion) { /* MotionNotify */ 310 if (xevent.type == data->motion) { /* MotionNotify */
311 XDeviceMotionEvent *move = (XDeviceMotionEvent *) & xevent; 311 XDeviceMotionEvent *move =
312 (XDeviceMotionEvent *) & xevent;
312 #ifdef DEBUG_MOTION 313 #ifdef DEBUG_MOTION
313 printf("X11 motion: %d,%d\n", move->x, move->y); 314 printf("X11 motion: %d,%d\n", move->x, move->y);
314 #endif 315 #endif
315 SDL_SendMouseMotion(move->deviceid, 0, move->x, move->y, move->axis_data[2]); 316 SDL_SendMouseMotion(move->deviceid, 0, move->x, move->y,
316 return; 317 move->axis_data[2]);
317 } 318 return;
318 if (xevent.type == data->button_pressed) { /* ButtonPress */ 319 }
319 XDeviceButtonPressedEvent *pressed = 320 if (xevent.type == data->button_pressed) { /* ButtonPress */
320 (XDeviceButtonPressedEvent *) & xevent; 321 XDeviceButtonPressedEvent *pressed =
321 SDL_SendMouseButton(pressed->deviceid, SDL_PRESSED, pressed->button); 322 (XDeviceButtonPressedEvent *) & xevent;
322 return; 323 SDL_SendMouseButton(pressed->deviceid, SDL_PRESSED,
323 } 324 pressed->button);
324 if (xevent.type == data->button_released) { /* ButtonRelease */ 325 return;
325 XDeviceButtonReleasedEvent *released = 326 }
326 (XDeviceButtonReleasedEvent *) & xevent; 327 if (xevent.type == data->button_released) { /* ButtonRelease */
327 SDL_SendMouseButton(released->deviceid, SDL_RELEASED, released->button); 328 XDeviceButtonReleasedEvent *released =
328 return; 329 (XDeviceButtonReleasedEvent *) & xevent;
329 } 330 SDL_SendMouseButton(released->deviceid, SDL_RELEASED,
330 if (xevent.type == data->proximity_in) { 331 released->button);
331 XProximityNotifyEvent *proximity = 332 return;
332 (XProximityNotifyEvent *) & xevent; 333 }
333 SDL_SendProximity(proximity->deviceid, proximity->x, proximity->y, SDL_PROXIMITYIN); 334 if (xevent.type == data->proximity_in) {
334 return; 335 XProximityNotifyEvent *proximity =
335 } 336 (XProximityNotifyEvent *) & xevent;
336 if (xevent.type == data->proximity_out) { 337 SDL_SendProximity(proximity->deviceid, proximity->x,
337 XProximityNotifyEvent *proximity = 338 proximity->y, SDL_PROXIMITYIN);
338 (XProximityNotifyEvent *) & xevent; 339 return;
339 SDL_SendProximity(proximity->deviceid, proximity->x, proximity->y, SDL_PROXIMITYOUT); 340 }
340 return; 341 if (xevent.type == data->proximity_out) {
341 } 342 XProximityNotifyEvent *proximity =
342 } 343 (XProximityNotifyEvent *) & xevent;
344 SDL_SendProximity(proximity->deviceid, proximity->x,
345 proximity->y, SDL_PROXIMITYOUT);
346 return;
347 }
348 }
343 #endif 349 #endif
344 #ifdef DEBUG_XEVENTS 350 #ifdef DEBUG_XEVENTS
345 printf("Unhandled event %d\n", xevent.type); 351 printf("Unhandled event %d\n", xevent.type);
346 #endif 352 #endif
347 } 353 }