-
安装python环境
参考:www.liaoxuefeng.com/wiki/101695…
Requires Python 3.6+
Async API requires Python 3.8+
-
安装Python wrapper around AHK
pip install ahk -
安装最新版的AHK,旧版运行时可能触发莫名错误
其他版本
AHK中文文档
-
运行
from ahk import AHK ahk = AHK(executable_path='path/to/lastest/version/of/ahk.exe') ahk.mouse_move(x=100, y=100, blocking=True) # Blocks until mouse finishes moving (the default) ahk.mouse_move(x=150, y=150, speed=10, blocking=True) # Moves the mouse to x, y taking 'speed' seconds to move print(ahk.mouse_position) # (150, 150)