From: Peter Hutterer Date: Tue, 16 Aug 2011 01:39:02 +0000 (+1000) Subject: test-xi2: print the correct flags, depending on the event type X-Git-Url: https://diplodocus.org/git/xorg-xinput/commitdiff_plain/2c5187d0099e6c7588828ba9931d27f5c64bbaec?ds=inline;hp=--cc test-xi2: print the correct flags, depending on the event type Signed-off-by: Peter Hutterer Reviewed-by: Julien Cristau --- 2c5187d0099e6c7588828ba9931d27f5c64bbaec diff --git a/src/test_xi2.c b/src/test_xi2.c index 3c3fee3..619a6b2 100644 --- a/src/test_xi2.c +++ b/src/test_xi2.c @@ -48,7 +48,17 @@ static void print_deviceevent(XIDeviceEvent* event) printf(" device: %d (%d)\n", event->deviceid, event->sourceid); printf(" detail: %d\n", event->detail); - printf(" flags: %s\n", (event->flags & XIKeyRepeat) ? "repeat" : ""); + switch(event->evtype) { + case XI_KeyPress: + case XI_KeyRelease: + printf(" flags: %s\n", (event->flags & XIKeyRepeat) ? "repeat" : ""); + break; + case XI_ButtonPress: + case XI_ButtonRelease: + case XI_Motion: + printf(" flags: %s\n", (event->flags & XIPointerEmulated) ? "emulated" : ""); + break; + } printf(" root: %.2f/%.2f\n", event->root_x, event->root_y); printf(" event: %.2f/%.2f\n", event->event_x, event->event_y);