Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在自动化我的应用程序。为此,我需要将鼠标移动到所选项目。我将用我的键盘选择该项目,鼠标将相应地移动到该点。在 Ubuntu 12.04 和 12.10 中是否有任何代码可以执行此操作。我正在使用 Python 进行自动化。
假设你:
您可以在 python 脚本中执行此操作:
from subprocess import call call(["xdotool", "mousemove", "300", "500"])
如果您没有安装 xdotool,您可能需要安装它:
sudo apt-get install xdotool
您可能想man xdotool获得更多关于它的信息 - 它对于自动化键盘/鼠标事件非常棒!
man xdotool