From 6a794ab3ceb6d3527c0a87f610bc1d6cf26971ba Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Thu, 1 Jul 2010 18:36:42 -0400 Subject: [PATCH] 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 --- src/test_xi2.c | 5 ++--- 1 file 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); -- 2.56.0