I'm wondering how to set the mouse cursor position under X11? Is it possible at all and if, where do I have to look for appropriate functions? X window system, KDE/Gnome/...?
Asked
Active
Viewed 1.9k times
4
-
Well, which are you using? X, KDE, Gnome, or something else? Each has their own solution. – David Z Feb 23 '09 at 18:47
-
Well... actually meant the *mouse* cursor :-/ And I am looking for a solution that is as universal as possible. – okoman Feb 23 '09 at 18:59
5 Answers
7
Sounds like you're using X, so what you probably want is XWarpPointer
. To give an absolute position on the whole screen, use the Root Window as dest window.
(You can get a quick and dirty list of X functions using ls /usr/share/man/man3/ | grep '^X'
)

cjm
- 61,471
- 9
- 126
- 175
-
1See http://tronche.com/gui/x/xlib/input/XWarpPointer.html To give an absolute position on the whole screen, use the Root Window as dest window. – ypnos Feb 23 '09 at 20:09
-
6
I know the question is old, but I just discovered xdotool and it seems great:

AkiRoss
- 11,745
- 6
- 59
- 86
0
0
If you are doing it in an xterm, the Xterm understands ANSI control codes. There is a list of these codes here.