Merge pull request #26 from Pieterv24/fix/matrix_test

fix: Fixed bug that crashes matrix_text when encoders are present
main
xyzz 2021-04-27 06:23:59 -04:00 committed by GitHub
commit 5cdb10c8cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -89,13 +89,14 @@ class MatrixTest(BasicEditor):
# write matrix state to keyboard widget
for w in self.keyboardWidget.widgets:
row = w.desc.row
col = w.desc.col
if w.desc.row is not None and w.desc.col is not None:
row = w.desc.row
col = w.desc.col
if row < len(matrix) and col < len(matrix[row]):
w.setPressed(matrix[row][col])
if matrix[row][col]:
w.setActive(True)
if row < len(matrix) and col < len(matrix[row]):
w.setPressed(matrix[row][col])
if matrix[row][col]:
w.setActive(True)
self.keyboardWidget.update_layout()
self.keyboardWidget.update()