remember pressed keys and release the same keys when the physical switch is opened, even if the layer has changed between key down and key up and a different key is now active for that matrix position

This commit is contained in:
Christian Tu
2021-09-17 15:59:57 +02:00
parent 27cf8e7d4d
commit f36a18513b
2 changed files with 13 additions and 8 deletions

View File

@@ -148,7 +148,19 @@ class KMKKeyboard:
print('MatrixChange(col={} row={} pressed={})'.format(col, row, is_pressed))
int_coord = intify_coordinate(row, col)
kc_changed = self._find_key_in_map(int_coord, row, col)
kc_changed = None
if not is_pressed:
kc_changed = self._coordkeys_pressed[int_coord]
if self.debug_enabled:
print('PressedKeyResolution(key={})'.format(self.state_layer_key))
if kc_changed is None:
kc_changed = self._find_key_in_map(int_coord, row, col)
if is_pressed:
self._coordkeys_pressed[int_coord] = kc_changed
else:
self._coordkeys_pressed[int_coord] = None
if kc_changed is None:
print('MatrixUndefinedCoordinate(col={} row={})'.format(col, row))