X-Git-Url: https://diplodocus.org/git/xorg-xinput/blobdiff_plain/9a20ce005c12cea9cf215125c96a00c7cbe988c7..09b075863708e43b9c1202dd052f36d5f865f571:/src/test_xi2.c diff --git a/src/test_xi2.c b/src/test_xi2.c index aa1a9a8..53d984f 100644 --- a/src/test_xi2.c +++ b/src/test_xi2.c @@ -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,25 +153,28 @@ 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) { - case NotifyNormal: mode = "NotifyNormal"; break; - case NotifyGrab: mode = "NotifyGrab"; break; - case NotifyUngrab: mode = "NotifyUngrab"; break; - case NotifyWhileGrabbed: mode = "NotifyWhileGrabbed"; break; + case XINotifyNormal: mode = "NotifyNormal"; break; + 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) { - case NotifyAncestor: detail = "NotifyAncestor"; break; - case NotifyVirtual: detail = "NotifyVirtual"; break; - case NotifyInferior: detail = "NotifyInferior"; break; - case NotifyNonlinear: detail = "NotifyNonlinear"; break; - case NotifyNonlinearVirtual: detail = "NotifyNonlinearVirtual"; break; - case NotifyPointer: detail = "NotifyPointer"; break; - case NotifyPointerRoot: detail = "NotifyPointerRoot"; break; - case NotifyDetailNone: detail = "NotifyDetailNone"; break; + case XINotifyAncestor: detail = "NotifyAncestor"; break; + case XINotifyVirtual: detail = "NotifyVirtual"; break; + case XINotifyInferior: detail = "NotifyInferior"; break; + case XINotifyNonlinear: detail = "NotifyNonlinear"; break; + case XINotifyNonlinearVirtual: detail = "NotifyNonlinearVirtual"; break; + case XINotifyPointer: detail = "NotifyPointer"; break; + case XINotifyPointerRoot: detail = "NotifyPointerRoot"; break; + case XINotifyDetailNone: detail = "NotifyDetailNone"; break; } printf(" mode: %s (detail %s)\n", mode, detail); printf(" flags: %s %s\n", event->focus ? "[focus]" : "", @@ -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;