+
+#ifdef ECORE_XI2
+ if (xevent->xcookie.type == GenericEvent &&
+ xevent->xcookie.extension == opcode)
+ {
+ if (XGetEventData(_ecore_x_disp &(xevent->xcookie)))
+ {
+ XIDeviceEvent* evd = (XIDeviceEvent *)(xevent->xcookie.data);
+ int devid = evd->deviceid;
+
+ //printf("deviceID = %d\n", devid);
+ switch (xevent->xcookie.evtype)
+ {
+ case XI_Motion:
+ _ecore_mouse_move
+ (xevent->xcookie.time, // ???
+ 0, // state
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y,
+ xevent->xcookie.window, // ???
+ (xevent->xbutton.subwindow ? xevent->xbutton.subwindow : xevent->xbutton.window), // ???
+ xevent->xcookie.root, // ???
+ xevent->xcookie.same_screen, // ???
+ devid, 1, 1);
+
+ //printf("motion\n");
+ printf("=");
+ break;
+ case XI_ButtonPress:
+ _ecore_mouse_button
+ (ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ (xevent->xcookie.time, // ???
+ 0, // state
+ 0, // button
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y,
+ xevent->xcookie.window, // ???
+ (xevent->xbutton.subwindow ? xevent->xbutton.subwindow : xevent->xbutton.window), // ???
+ xevent->xcookie.root, // ???
+ xevent->xcookie.same_screen, // ???
+ devid, 1, 1);
+ //printf("abs X:%f Y:%f - ", evd->root_x, evd->root_y);
+ //printf("win X:%f Y:%f\n", evd->event_x, evd->event_y);
+ printf("[[");
+ break;
+ case XI_ButtonRelease:
+ _ecore_mouse_button
+ (ECORE_EVENT_MOUSE_BUTTON_UP,
+ (xevent->xcookie.time, // ???
+ 0, // state
+ 0, // button
+ evd->event_x, evd->event_y,
+ evd->root_x, evd->root_y,
+ xevent->xcookie.window, // ???
+ (xevent->xbutton.subwindow ? xevent->xbutton.subwindow : xevent->xbutton.window), // ???
+ xevent->xcookie.root, // ???
+ xevent->xcookie.same_screen, // ???
+ devid, 1, 1);
+ //printf("unclick\n");
+ printf("]]\n");
+ break;
+ }
+ }
+ }
+ XFreeEventData(_ecore_x_disp &(xevent->xcookie));
+#endif