Add debug hooks to the event dispatcher, remove explicit prints

This commit is contained in:
Josh Klar
2018-09-03 13:50:12 -07:00
parent d9b909d841
commit ef639f5292
6 changed files with 98 additions and 84 deletions

18
kmk/common/event_defs.py Normal file
View File

@@ -0,0 +1,18 @@
from micropython import const
KEY_UP_EVENT = const(1)
KEY_DOWN_EVENT = const(2)
def key_up_event(keycode):
return {
'type': KEY_UP_EVENT,
'keycode': keycode,
}
def key_down_event(keycode):
return {
'type': KEY_DOWN_EVENT,
'keycode': keycode,
}