]> diplodocus.org Git - xorg-xinput/blobdiff - src/test_xi2.c
Add Peter and Red Hat's copyright notices and licenses to COPYING
[xorg-xinput] / src / test_xi2.c
index 39f4f19568bd62a0948677d34d767936b6031601..53d984f04b9bd2919226b04e86e8656b7cb6c34a 100644 (file)
@@ -48,6 +48,7 @@ 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" : "");
 
     printf("    root: %.2f/%.2f\n", event->root_x, event->root_y);
     printf("    event: %.2f/%.2f\n", event->event_x, event->event_y);
@@ -152,6 +153,7 @@ static void print_enterleave(XILeaveEvent* event)
     char *mode, *detail;
     int i;
 
+    printf("    device: %d\n", event->deviceid);
     printf("    windows: root 0x%lx event 0x%lx child 0x%ld\n",
             event->root, event->event, event->child);
     switch(event->mode)
@@ -160,6 +162,8 @@ static void print_enterleave(XILeaveEvent* event)
         case XINotifyGrab:         mode = "NotifyGrab"; break;
         case XINotifyUngrab:       mode = "NotifyUngrab"; break;
         case XINotifyWhileGrabbed: mode = "NotifyWhileGrabbed"; break;
+        case XINotifyPassiveGrab:  mode = "NotifyPassiveGrab"; break;
+        case XINotifyPassiveUngrab:mode = "NotifyPassiveUngrab"; break;
     }
     switch (event->detail)
     {
@@ -300,10 +304,10 @@ test_xi2(Display  *display,
         XISetMask(mask.mask, XI_Motion);
         XIGrabButton(display, 2, 1, win, None, GrabModeAsync, GrabModeAsync,
                 False, &mask, nmods, modifiers);
-        XIGrabKeysym(display, 3, 0x71, win, GrabModeAsync, GrabModeAsync,
+        XIGrabKeycode(display, 3, 24 /* q */, win, GrabModeAsync, GrabModeAsync,
                 False, &mask, nmods, modifiers);
         XIUngrabButton(display, 3, 1, win, nmods - 2, &modifiers[2]);
-        XIUngrabKeysym(display, 3, 0x71, win, nmods - 2, &modifiers[2]);
+        XIUngrabKeycode(display, 3, 24 /* q */, win, nmods - 2, &modifiers[2]);
     }
 
     mask.deviceid = XIAllMasterDevices;