implement support for multiple scanners at once
fixup
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user