-
-
Save den-run-ai/97be66684366b5526e1df38f46dbdfc0 to your computer and use it in GitHub Desktop.
Revisions
-
Sebelino revised this gist
Apr 24, 2016 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,8 +14,6 @@ class KeyListener(PyKeyboardEvent): def __init__(self): PyKeyboardEvent.__init__(self) def handler(self, reply): print("Handle keypress here...") -
Sebelino created this gist
Apr 24, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ #!/usr/bin/env python # The following is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. from pykeyboard import PyKeyboardEvent from pymouse import PyMouseEvent from threading import Thread from time import sleep class KeyListener(PyKeyboardEvent): def __init__(self): PyKeyboardEvent.__init__(self) self.callno = 0 self.pressedkeys = set() def handler(self, reply): print("Handle keypress here...") class MouseListener(PyMouseEvent): def __init__(self): PyMouseEvent.__init__(self) def click(self, x, y, button, press): print("Handle mousepress here...") if __name__ == '__main__': keylistener = KeyListener() mouselistener = MouseListener() kt = Thread(target=keylistener.run) mt = Thread(target=mouselistener.run) kt.start() mt.start() while True: print("Running...") sleep(10)