implement support for multiple scanners at once

fixup
This commit is contained in:
xs5871 authored and Kyle Brown committed 2022-04-17 18:33:14 -07:00
1 parent c7490087b6
commit 7ff77b97bb
5 files changed
+31 -17

No files matched your search

+7 -2
View File
@@ -22,7 +22,12 @@ class Scanner:
Base class for scanners.
'''
coord_mapping = None
# for split keyboards, the offset value will be assigned in Split module
offset = 0
@property
def coord_mapping(self):
return tuple(range(self.offset, self.offset + self.key_count))
@property
def key_count(self):
@@ -34,4 +39,4 @@ class Scanner:
The key report is a byte array with contents [row, col, True if pressed else False]
'''
pass
raise NotImplementedError
-1
View File
@@ -78,7 +78,6 @@ class MatrixScanner(Scanner):
self.rollover_cols_every_rows = self.len_rows
self._key_count = self.len_cols * self.len_rows
self.coord_mapping = tuple(range(self.key_count))
self.state = bytearray(self.key_count)
@property
-3
View File
@@ -12,9 +12,6 @@ class KeypadScanner(Scanner):
'''
def __init__(self):
# for split keyboards, the offset value will be assigned in Split module
self.offset = 0
self.coord_mapping = tuple(range(self.key_count))
self.curr_event = keypad.Event()
@property