Can I use Python to capture keyboard and mouse events in OSX?

前端 未结 5 1760
既然无缘
既然无缘 2021-02-08 04:53

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

5条回答
  •  南旧
    南旧 (楼主)
    2021-02-08 05:22

    Here's a solution without using curses:

    http://docs.python.org/faq/library.html#how-do-i-get-a-single-keypress-at-a-time

    This question was asked some time back here - Python cross-platform listening for keypresses?

    You might find the sample code there helpful!

提交回复
热议问题