summaryrefslogtreecommitdiff
path: root/app/xinput/src/test_xi2.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-03-28 13:08:56 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-03-28 13:08:56 +0000
commitcfcd86112f930b8a8dc9abdc2693b261c3de1070 (patch)
treeec3b68f872c055c2f59ca904ef15817edca8c4e8 /app/xinput/src/test_xi2.c
parenta7ed61dcf673ad701c92e2766499747edf2ab397 (diff)
Update to xinput 1.5.1
Diffstat (limited to 'app/xinput/src/test_xi2.c')
-rw-r--r--app/xinput/src/test_xi2.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/app/xinput/src/test_xi2.c b/app/xinput/src/test_xi2.c
index 53d984f04..6fdc4ad39 100644
--- a/app/xinput/src/test_xi2.c
+++ b/app/xinput/src/test_xi2.c
@@ -258,6 +258,35 @@ test_sync_grab(Display *display, Window win)
printf("Done\n");
}
+static const char* type_to_name(int evtype)
+{
+ const char *name;
+
+ switch(evtype) {
+ case XI_DeviceChanged: name = "DeviceChanged"; break;
+ case XI_KeyPress: name = "KeyPress"; break;
+ case XI_KeyRelease: name = "KeyRelease"; break;
+ case XI_ButtonPress: name = "ButtonPress"; break;
+ case XI_ButtonRelease: name = "ButtonRelease"; break;
+ case XI_Motion: name = "Motion"; break;
+ case XI_Enter: name = "Enter"; break;
+ case XI_Leave: name = "Leave"; break;
+ case XI_FocusIn: name = "FocusIn"; break;
+ case XI_FocusOut: name = "FocusOut"; break;
+ case XI_HierarchyChanged: name = "HierarchyChanged"; break;
+ case XI_PropertyEvent: name = "PropertyEvent"; break;
+ case XI_RawKeyPress: name = "RawKeyPress"; break;
+ case XI_RawKeyRelease: name = "RawKeyRelease"; break;
+ case XI_RawButtonPress: name = "RawButtonPress"; break;
+ case XI_RawButtonRelease: name = "RawButtonRelease"; break;
+ case XI_RawMotion: name = "RawMotion"; break;
+ default:
+ name = "unknown event type"; break;
+ }
+ return name;
+}
+
+
int
test_xi2(Display *display,
int argc,
@@ -341,7 +370,7 @@ test_xi2(Display *display,
cookie->type == GenericEvent &&
cookie->extension == xi_opcode)
{
- printf("EVENT type %d\n", cookie->evtype);
+ printf("EVENT type %d (%s)\n", cookie->evtype, type_to_name(cookie->evtype));
switch (cookie->evtype)
{
case XI_DeviceChanged: