Skip to content

Instantly share code, notes, and snippets.

@edfungus
Last active August 29, 2015 14:07
Show Gist options
  • Save edfungus/0928815267cfbad5afa2 to your computer and use it in GitHub Desktop.
Save edfungus/0928815267cfbad5afa2 to your computer and use it in GitHub Desktop.
Getting Mouse Click Event
##USE Xlib VERSION 14!!!! NOT 15!!!!
from pymouse import PyMouseEvent
class Clickonacci(PyMouseEvent):
def __init__(self):
PyMouseEvent.__init__(self)
def click(self, x, y, button, press):
if button == 1:
if press:
print('click!')
else: # Exit if any other mouse button used
self.stop()
C = Clickonacci()
C.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment