From: Chase Douglas Date: Thu, 1 Jul 2010 22:36:42 +0000 (-0400) Subject: xinput: Split XI2 valuators and print index of events X-Git-Url: https://diplodocus.org/git/xorg-xinput/commitdiff_plain/6a794ab3ceb6d3527c0a87f610bc1d6cf26971ba?ds=inline;hp=--cc 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 Signed-off-by: Peter Hutterer --- 6a794ab3ceb6d3527c0a87f610bc1d6cf26971ba 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);