Initial attempt to merge internal_state with kmk_keyboard. Seems to work on Plank so far

This commit is contained in:
Josh Klar committed 2021-06-20 13:53:39 -07:00
1 parent ea327f8f76
commit 9821f7bcc3
15 files changed
+879 -812

No files matched your search

+42
View File
@@ -0,0 +1,42 @@
class InvalidExtensionEnvironment(Exception):
pass
class Extension:
_enabled = True
def enable(self, keyboard):
self._enabled = True
self.on_runtime_enable(self, keyboard)
def disable(self, keyboard):
self._enabled = False
self.on_runtime_disable(self, keyboard)
# The below methods should be implemented by subclasses
def on_runtime_enable(self, keyboard):
pass
def on_runtime_disable(self, keyboard):
pass
def during_bootup(self, keyboard):
pass
def before_matrix_scan(self, keyboard):
'''
Return value will be injected as an extra matrix update
'''
pass
def after_matrix_scan(self, keyboard, matrix_update):
pass
def before_hid_send(self, keyboard):
pass
def after_hid_send(self, keyboard):
pass