#include < stdio.h >
#include < stdlib.h >
#include < string.h >
#ifdef WIN32
#include < windows.h >
#else
#include < unistd.h >
#include < X11/X.h >
#include < X11/Xlib.h >
#endif
int main(int argc, char* argv[])
{
char sx[10], sy[10];
int x, y;
if ( argc < 3 ) return 0;
strcpy(sx, argv[1]);
strcpy(sy, argv[2]);
x = atoi(sx);
y = atoi(sy);
#ifdef WIN32
SetCursorPos(x, y);
#else
Display *dpy;
Window rootwindow;
dpy = XOpenDisplay(NULL);
if ( ! dpy ) {
printf("Couldn't open Xdisplay.\n");
exit(1);
}
rootwindow = DefaultRootWindow(dpy);
XWarpPointer(dpy, rootwindow, rootwindow, 0, 0, 0, 0, x, y);
XCloseDisplay(dpy);
#endif
return 0;
}