Wednesday, April 29, 2009

XWarpPointer

Just came across a way to move the mouse pointer to an absolute position in X. Follow the code below:
int main()
{
Display* xdisplay1 = XOpenDisplay(NULL);
if(!xdisplay1) {
printf("display = null\n");
}
Window root = DefaultRootWindow(xdisplay1);
XWarpPointer(xdisplay1, 0, root, 0, 0, 0, 0, 10, 10);
XCloseDisplay(xdisplay1);

}

No comments:

Post a Comment