comparison src/events/SDL_mouse.c @ 2842:97ba0be8b565

Date: Sat, 06 Dec 2008 15:27:00 +0100 From: Couriersud Subject: SDL: Relative mouse movements The patch below will reenable processing of relative mouse movements. The DirectFB drivers generates those in "grabbed" mode. These ensure, that even in fullscreen mode relative movements are reported. SDLMAME depends on this for games with trackballs. Looking at the code I ask myself whether relative movements should be handled in the drivers (x11, directfb). Both x11 and directfb are able to report relative movements. This would leave it to the driver to use the most appropriate method for relative movements when at the border of a fullscreen window or being "grabbed".
author Sam Lantinga <slouken@libsdl.org>
date Sat, 06 Dec 2008 17:50:50 +0000
parents f7872b7a8732
children 523b10db69f8
comparison
equal deleted inserted replaced
2841:483f85e35a1a 2842:97ba0be8b565
431 last_y = y; 431 last_y = y;
432 return 0; 432 return 0;
433 } 433 }
434 434
435 /* the relative motion is calculated regarding the system cursor last position */ 435 /* the relative motion is calculated regarding the system cursor last position */
436 436 if (relative) {
437 xrel = x - last_x; 437 xrel = x;
438 yrel = y - last_y; 438 yrel = y;
439 x = (last_x + x);
440 y = (last_y + y);
441 } else {
442 xrel = x - last_x;
443 yrel = y - last_y;
444 }
439 445
440 /* Drop events that don't change state */ 446 /* Drop events that don't change state */
441 if (!xrel && !yrel) { 447 if (!xrel && !yrel) {
442 #if 0 448 #if 0
443 printf("Mouse event didn't change state - dropped!\n"); 449 printf("Mouse event didn't change state - dropped!\n");