How to set the mouse position under X11 (linux des

2020-02-11 07:29发布

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/...?

标签: mouse x11
5条回答
小情绪 Triste *
2楼-- · 2020-02-11 07:34

Try using xte command (part of xautomation package). Details here

查看更多
唯我独甜
3楼-- · 2020-02-11 07:35

To do from a shell script, use the xwit commandline tool.

查看更多
走好不送
4楼-- · 2020-02-11 07:37

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

查看更多
smile是对你的礼貌
5楼-- · 2020-02-11 07:54

I know the question is old, but I just discovered xdotool and it seems great:

http://www.semicomplete.com/projects/xdotool/

查看更多
萌系小妹纸
6楼-- · 2020-02-11 07:55

If you are doing it in an xterm, the Xterm understands ANSI control codes. There is a list of these codes here.

查看更多
登录 后发表回答