Simplify splits, expand extentions

This commit is contained in:
Kyle Brown
2020-10-28 17:39:49 -07:00
parent 994012b249
commit 6d941a39bf
6 changed files with 48 additions and 43 deletions

View File

@@ -36,6 +36,8 @@ class KMKKeyboard:
_coord_keys_pressed = {}
_hid_helper = None
_hid_pending = False
_matrix_update = None
_matrix_modify = None
# this should almost always be PREpended to, replaces
# former use of reversed_active_layers which had pointless
@@ -373,15 +375,21 @@ class KMKKeyboard:
except Exception as e:
print('Failed to run pre matrix function: ', e)
matrix_update = self.matrix.scan_for_changes()
self._handle_matrix_report(matrix_update)
self._matrix_update = self.matrix.scan_for_changes()
for ext in self.extensions:
try:
ext.after_matrix_scan(self, matrix_update)
self._matrix_modify = ext.after_matrix_scan(
self, self._matrix_update
)
if self._matrix_modify is not None:
self._matrix_update = self._matrix_modify
except Exception as e:
print('Failed to run post matrix function: ', e)
self._handle_matrix_report(self._matrix_update)
self._matrix_update = None
for ext in self.extensions:
try:
ext.before_hid_send(self)