diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-08-16 11:39:02 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-08-19 10:48:46 +1000 |
commit | 2c5187d0099e6c7588828ba9931d27f5c64bbaec (patch) | |
tree | 12c021ace202f1a0eee984f1938acde1f4bcf19e /src | |
parent | 4be60c90008ac48e72e819e078ce957fd003a509 (diff) |
test-xi2: print the correct flags, depending on the event type
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/test_xi2.c | 12 |
1 files changed, 11 insertions, 1 deletions
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); |