summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2010-07-01 18:36:42 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2010-07-02 11:14:30 +1000
commit6a794ab3ceb6d3527c0a87f610bc1d6cf26971ba (patch)
tree3579ba451eb6a348fa886844b59a8f6f679fbef2
parenta5c9b0ffb969f71ec73a6c65f5135f5aa7805a38 (diff)
xinput: Split XI2 valuators and print index of events
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>
-rw-r--r--src/test_xi2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test_xi2.c b/src/test_xi2.c
index 9ddb291..c59ba26 100644
--- a/src/test_xi2.c
+++ b/src/test_xi2.c
@@ -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);