]> diplodocus.org Git - xorg-xinput/commitdiff
xinput: Split XI2 valuators and print index of events
authorChase Douglas <chase.douglas@canonical.com>
Thu, 1 Jul 2010 22:36:42 +0000 (18:36 -0400)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 2 Jul 2010 01:14:30 +0000 (11:14 +1000)
XI2 events support bitmask selected valuators. When printing masked
events, we need to also print the index of the valuator value. This
change prints each valuator on its own line, prefixed by its index

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/test_xi2.c

index 9ddb2912340a95def1aa73888ce0d2b185df7817..c59ba263e8296a353ea30aec37f59e5194374d0d 100644 (file)
@@ -65,13 +65,12 @@ static void print_deviceevent(XIDeviceEvent* event)
     printf("    group: locked %#x latched %#x base %#x effective: %#x\n",
             event->group.locked, event->group.latched,
             event->group.base, event->group.effective);
-    printf("    valuators:");
+    printf("    valuators:\n");
 
     val = event->valuators.values;
     for (i = 0; i < event->valuators.mask_len * 8; i++)
         if (XIMaskIsSet(event->valuators.mask, i))
-            printf(" %.2f", *val++);
-    printf("\n");
+            printf("        %i: %.2f\n", i, *val++);
 
     printf("    windows: root 0x%lx event 0x%lx child 0x%ld\n",
             event->root, event->event, event->child);