From 1aaae114e7f3ec7606fcd07def83756736f47a3d Mon Sep 17 00:00:00 2001 From: teascade Date: Tue, 11 Dec 2018 00:58:02 +0200 Subject: [PATCH] Make a neatness change and enable debug with --debug --- main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index ce2bfcc..2aab8d9 100644 --- a/main.py +++ b/main.py @@ -16,10 +16,14 @@ class Main: bongocat = Bongocat() clackmanager = Clackmanager() - debug = True + debug = len(sys.argv) > 1 and sys.argv[1] == '--debug' sounds = False def init(self, linux): + if linux: + from pyxhook import HookManager + else: + from pyHook import HookManager hooks_manager = HookManager() hooks_manager.KeyDown = self.OnKeyDown @@ -70,7 +74,6 @@ class Main: def OnKeyDown(self, event): self.input_manager.press_key(event.Key) - print event.Message return True def OnKeyUp(self, event): @@ -88,10 +91,8 @@ class Main: if __name__ == "__main__": from sys import platform if platform == "linux" or platform == "linux2": - from pyxhook import HookManager linux = True else: - from pyHook import HookManager linux = False main = Main()