Last active
May 29, 2016 16:56
-
-
Save d1manson/97c45f8c98fc8cc7c6939390209176b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
pip install | |
Download pyhook .whl file from: | |
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pyhook | |
Note if you have python 2.7, and 64 bit you need the version: | |
"pyHook-1.5.1-cp27-none-win_amd64.whl" | |
otherwise choose the relevant one. | |
Then open a comand prompt, cd to your downloads folder and run | |
pip install "the_file_name.whl" | |
Then | |
pip install PyUserInput | |
""" | |
from pymouse import PyMouseEvent | |
class CustomMouse(PyMouseEvent): | |
def __init__(self): | |
PyMouseEvent.__init__(self) | |
# custom init goes here | |
def move(self, x, y): | |
print(x, y) | |
def click(self, x, y, button, press): | |
if button == 1: | |
self.stop() | |
m = CustomMouse() | |
m.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment