Created
July 20, 2018 14:28
-
-
Save zezic/43255702182055481376a11604d6731c to your computer and use it in GitHub Desktop.
Produce Enter key tap when left mouse button clicked
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
from pymouse import PyMouseEvent | |
from pykeyboard import PyKeyboard | |
class Listener(PyMouseEvent): | |
def __init__(self): | |
PyMouseEvent.__init__(self) | |
self.keyboard = PyKeyboard() | |
def click(self, x, y, button, press): | |
if button == 1: | |
if press: | |
print('producing enter') | |
self.keyboard.tap_key(self.keyboard.enter_key) | |
listener = Listener() | |
listener.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You will need pyuserinput library to run this. Install it like this: