This Python module make use of OpenCV, NumPy and Quartz to control mouse and keyboard events automatically, [CV] 4'ing your OS X screen.
In order to compile Pytomator you must be on OS X 10.8 or higher and have OpenCV installed on your machine.
Run
$ brew install opencv
Then follow the instructions given by Homebrew.
To install pytomator run
$ sudo pip install git+git://github.com/danieleciriello/Pytomator
Add this lines to your file to add pytomator to your Python module
from pytomator import pytomator
You must provide an image to the match function, which return the center coordinates of the matched area, you can then click, drag, or move the mouse at such coordinates.
x, y = pytomator.match(template_path)
pytomator.mouseclick_visive(x, y)
You can control key pressing events in this way
for c in 'spam':
pytomator.keyboard.press_key(c)
pytomator.keyboard.release_key(c)
Copyright (c) 2014 Daniele Ciriello
See LICENSE.txt for license information.
- Thanks to SavinaRoja for base.py and keyboard.py (originally mac.py)
- Suggestions are welcome