Hi. I've made a code. The code is not 100% working, so i ned help with that.
The tiny litle program is gonna work so it move the mouse, and then click with it. Both right and left click. And i don't know how to do that?
#include <iostream>
#include <X11/Xlib.h>
using namespace std;
void click_with_mouse(){
int delta_x = 450, delta_y = 780;
Display *display = XOpenDisplay(0);
Window root = DefaultRootWindow(display);
XWarpPointer(display, None, root, 0, 0, 0, 0, delta_x, delta_y);
XCloseDisplay(display);
}
int main()
{
cout << "Hi, now the mouse is on X = 450 and Y = 780 :)";
click_with_mouse();
return 0;
}
I will be very happy for help :)
//Heavy