Make a neatness change and enable debug with --debug
This commit is contained in:
parent
8250f43f61
commit
1aaae114e7
9
main.py
9
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()
|
||||
|
Loading…
Reference in New Issue
Block a user