我正在自动化我的应用程序。要在某一点上执行此操作,我需要将鼠标移动到所选项目。我将使用键盘选择项目,鼠标将相应地移动到该点。在Ubuntu 12.04和12.10中是否有任何代码可以执行此操作。我正在使用Python进行自动化。
答案 0 :(得分:0)
假设你:
您可以在python脚本中执行此操作:
from subprocess import call
call(["xdotool", "mousemove", "300", "500"])
如果没有安装xdotool,可能需要安装xdotool:
sudo apt-get install xdotool
您可能希望man xdotool
获取更多相关信息 - 这对于自动执行键盘/鼠标事件非常棒!