-
- XQueryPointer(display, RootWindow(display, DefaultScreen(display)), &event.root, &event.window, &event.x_root, &event.y_root, &event.x, &event.y, &event.state);
- event.subwindow = event.window;
-
- while (event.subwindow)
- {
- event.window = event.subwindow;
- XQueryPointer(display, event.window, &event.root, &event.subwindow, &event.x_root, &event.y_root, &event.x, &event.y, &event.state);
- }
-
- XSendEvent(display, PointerWindow, True, mask, (XEvent*) &event);
- XFlush(display);
- XCloseDisplay(display);
+ event.type = type;
+ event.state = mod;
+ event.keycode = xkeycode;
+
+ XSendEvent(event.display, event.window, True, mask, (XEvent*) &event);