less than 1 minute read

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);

}

Tags:

Updated:

Leave a comment