Skip to content

Instantly share code, notes, and snippets.

@d1manson
Last active May 29, 2016 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d1manson/97c45f8c98fc8cc7c6939390209176b0 to your computer and use it in GitHub Desktop.
Save d1manson/97c45f8c98fc8cc7c6939390209176b0 to your computer and use it in GitHub Desktop.
"""
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