Last active
August 29, 2015 14:07
-
-
Save edfungus/0928815267cfbad5afa2 to your computer and use it in GitHub Desktop.
Getting Mouse Click Event
This file contains hidden or 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
##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