我可以使用Python捕获OSX中的键盘和鼠标事件吗?

我可以使用Python捕获OSX中的键盘和鼠标事件吗?

问题描述:

我正在尝试为OSX用Python编写一个简单的宏记录器-当脚本在后台运行时可以捕获鼠标和按键事件并重播它们.对于后者,我可以使用 autopy ,对于前者,是否有类似的简单库?

I'm trying to write a simple macro recorder in Python for OSX - something which can capture mouse and key events as the script runs in the background and replay them. I can use autopy for the latter, is there a similarly simple library for the former?

在OSX上的Python中似乎没有办法做到这一点.

There doesn't seem to be a way of doing this in Python on OSX.