feat(extensions): most of the extensions implementation, by kdb424

This commit is contained in:
Kyle Brown authored and Josh Klar committed 2021-06-20 13:55:16 -07:00
1 parent 9821f7bcc3
commit e72d2b8c34
140 files changed
+3860 -2312

No files matched your search

+19 -10
View File
@@ -8,35 +8,44 @@ class Extension:
def enable(self, keyboard):
self._enabled = True
self.on_runtime_enable(self, keyboard)
self.on_runtime_enable(keyboard)
def disable(self, keyboard):
self._enabled = False
self.on_runtime_disable(self, keyboard)
self.on_runtime_disable(keyboard)
# The below methods should be implemented by subclasses
def on_runtime_enable(self, keyboard):
pass
raise NotImplementedError
def on_runtime_disable(self, keyboard):
pass
raise NotImplementedError
def during_bootup(self, keyboard):
pass
raise NotImplementedError
def before_matrix_scan(self, keyboard):
'''
Return value will be injected as an extra matrix update
'''
pass
raise NotImplementedError
def after_matrix_scan(self, keyboard, matrix_update):
pass
def after_matrix_scan(self, keyboard):
'''
Return value will be replace matrix update if supplied
'''
raise NotImplementedError
def before_hid_send(self, keyboard):
pass
raise NotImplementedError
def after_hid_send(self, keyboard):
pass
raise NotImplementedError
def on_powersave_enable(self, keyboard):
raise NotImplementedError
def on_powersave_disable(self, keyboard):
raise NotImplementedError