Added finger events to SDLTest_PrintEvent().
authorRyan C. Gordon
Thu, 18 Jul 2013 22:20:09 -0400
changeset 7470e2c81eca0326
parent 7469 4310d5aee6fe
child 7471 75726efbf679
Added finger events to SDLTest_PrintEvent().
src/test/SDL_test_common.c
     1.1 --- a/src/test/SDL_test_common.c	Tue Jul 16 01:02:51 2013 -0700
     1.2 +++ b/src/test/SDL_test_common.c	Thu Jul 18 22:20:09 2013 -0400
     1.3 @@ -930,8 +930,8 @@
     1.4  static void
     1.5  SDLTest_PrintEvent(SDL_Event * event)
     1.6  {
     1.7 -    if (event->type == SDL_MOUSEMOTION) {
     1.8 -        /* Mouse motion is really spammy */
     1.9 +    if ((event->type == SDL_MOUSEMOTION) || (event->type == SDL_FINGERMOTION)) {
    1.10 +        /* Mouse and finger motion are really spammy */
    1.11          return;
    1.12      }
    1.13  
    1.14 @@ -1089,6 +1089,16 @@
    1.15      case SDL_CLIPBOARDUPDATE:
    1.16          fprintf(stderr, "Clipboard updated");
    1.17          break;
    1.18 +
    1.19 +    case SDL_FINGERDOWN:
    1.20 +    case SDL_FINGERUP:
    1.21 +        fprintf(stderr, "Finger: %s touch=%lld, finger=%lld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f",
    1.22 +                (event->type == SDL_FINGERDOWN) ? "down" : "up",
    1.23 +                event->tfinger.touchId, event->tfinger.fingerId,
    1.24 +                event->tfinger.x, event->tfinger.y,
    1.25 +                event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure);
    1.26 +        break;
    1.27 +
    1.28      case SDL_QUIT:
    1.29          fprintf(stderr, "Quit requested");
    1.30          break;