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

fix formatting

Example of new "Extension"/plugin system, using LED

Cleanup of RGB code

staticmethod to proper, normal methods

Needs cleanup, but: migrate Leader to Extension API

remove useless self reurns

fix an AttributeError with Leader key removal

Checkpoint from the weekend: split as an Extension (not working or done yet)

wip
This commit is contained in:
Josh Klar authored and Kyle Brown committed 2020-11-13 23:27:48 -08:00
1 parent b8cb4bda98
commit 2c4e866024
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