Results 1 to 2 of 2
Hi guys,
I am new x11 programming. I want to know the APIs for moving the cursor on the screen. Cursor in the sense mouse pointer. Is there is any ...
- 06-15-2006 #1Just Joined!
- Join Date
- May 2006
- Posts
- 24
using X11
Hi guys,
I am new x11 programming. I want to know the APIs for moving the cursor on the screen. Cursor in the sense mouse pointer. Is there is any way to move the mouse pointer on the screen from the application.
- 06-15-2006 #2
This should probably go in the Programming Forum, but...
Try XWarpPointer found in Xlib.h:
And to compile, you need the -lX11 option.Code:#include <X11/Xlib.h> #include <stdio.h> int main(void) { Display *dsp; Window root; dsp = XOpenDisplay(NULL); if(! dsp) { fprintf(stderr, "Unable to connect to X Display\n"); exit(1); } root = RootWindow(dsp, DefaultScreen(dsp)); /* This line moves the pointer to (100, 100) on the screen */ XWarpPointer(dsp, None, root, 0, 0, 0, 0, 100, 100); XFlush(dsp); return 0; }Flies of a particular kind, i.e. time-flies, are fond of an arrow.
Registered Linux User #408794


Reply With Quote
