Added finger events to SDLTest_PrintEvent().
authorRyan C. Gordon <icculus@icculus.org>
Thu, 18 Jul 2013 22:20:09 -0400
changeset 7470 e2c81eca0326
parent 7469 4310d5aee6fe
child 7471 75726efbf679
Added finger events to SDLTest_PrintEvent().
src/test/SDL_test_common.c
--- a/src/test/SDL_test_common.c	Tue Jul 16 01:02:51 2013 -0700
+++ b/src/test/SDL_test_common.c	Thu Jul 18 22:20:09 2013 -0400
@@ -930,8 +930,8 @@
 static void
 SDLTest_PrintEvent(SDL_Event * event)
 {
-    if (event->type == SDL_MOUSEMOTION) {
-        /* Mouse motion is really spammy */
+    if ((event->type == SDL_MOUSEMOTION) || (event->type == SDL_FINGERMOTION)) {
+        /* Mouse and finger motion are really spammy */
         return;
     }
 
@@ -1089,6 +1089,16 @@
     case SDL_CLIPBOARDUPDATE:
         fprintf(stderr, "Clipboard updated");
         break;
+
+    case SDL_FINGERDOWN:
+    case SDL_FINGERUP:
+        fprintf(stderr, "Finger: %s touch=%lld, finger=%lld, x=%f, y=%f, dx=%f, dy=%f, pressure=%f",
+                (event->type == SDL_FINGERDOWN) ? "down" : "up",
+                event->tfinger.touchId, event->tfinger.fingerId,
+                event->tfinger.x, event->tfinger.y,
+                event->tfinger.dx, event->tfinger.dy, event->tfinger.pressure);
+        break;
+
     case SDL_QUIT:
         fprintf(stderr, "Quit requested");
         break;