Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are brave, and you don't want to depend on any third party tool, you should use Xlib. Documentation can be found <a href="http://www.x.org/wiki/ProgrammingDocumentation/" rel="nofollow noreferrer">here</a>. Also you can try <a href="http://python-xlib.sourceforge.net/" rel="nofollow noreferrer">python-xlib</a> if you don't want to mess with C/C++.</p> <p>Check this <a href="http://www.linuxquestions.org/questions/programming-9/simulating-a-mouse-click-594576/" rel="nofollow noreferrer">thread</a> for an example (C/C++).</p> <p>This is an example of a program that receives a coord and simulates a mouse click at that position.</p> <pre><code>#include &lt;X11/Xlib.h&gt; #include&lt;stdio.h&gt; #include&lt;unistd.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; #include &lt;unistd.h&gt; #include &lt;X11/Xlib.h&gt; #include &lt;X11/Xutil.h&gt; void mouseClick(int button) { Display *display = XOpenDisplay(NULL); XEvent event; if(display == NULL) { fprintf(stderr, "Errore nell'apertura del Display !!!\n"); exit(EXIT_FAILURE); } memset(&amp;event, 0x00, sizeof(event)); event.type = ButtonPress; event.xbutton.button = button; event.xbutton.same_screen = True; XQueryPointer(display, RootWindow(display, DefaultScreen(display)), &amp;event.xbutton.root, &amp;event.xbutton.window, &amp;event.xbutton.x_root, &amp;event.xbutton.y_root, &amp;event.xbutton.x, &amp;event.xbutton.y, &amp;event.xbutton.state); event.xbutton.subwindow = event.xbutton.window; while(event.xbutton.subwindow) { event.xbutton.window = event.xbutton.subwindow; XQueryPointer(display, event.xbutton.window, &amp;event.xbutton.root, &amp;event.xbutton.subwindow, &amp;event.xbutton.x_root, &amp;event.xbutton.y_root, &amp;event.xbutton.x, &amp;event.xbutton.y, &amp;event.xbutton.state); } if(XSendEvent(display, PointerWindow, True, 0xfff, &amp;event) == 0) fprintf(stderr, "Error\n"); XFlush(display); usleep(100000); event.type = ButtonRelease; event.xbutton.state = 0x100; if(XSendEvent(display, PointerWindow, True, 0xfff, &amp;event) == 0) fprintf(stderr, "Error\n"); XFlush(display); XCloseDisplay(display); } int main(int argc,char * argv[]) { int i=0; int x , y; x=atoi(argv[1]); y=atoi(argv[2]); Display *display = XOpenDisplay(0); Window root = DefaultRootWindow(display); XWarpPointer(display, None, root, 0, 0, 0, 0, x, y); mouseClick(Button1); XFlush(display); XCloseDisplay(display); return 0; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload