2022-04-09 02:07:38 +02:00
|
|
|
def intify_coordinate(row, col, len_cols):
|
|
|
|
return len_cols * row + col
|
|
|
|
|
|
|
|
|
|
|
|
class DiodeOrientation:
|
|
|
|
'''
|
|
|
|
Orientation of diodes on handwired boards. You can think of:
|
|
|
|
COLUMNS = vertical
|
|
|
|
ROWS = horizontal
|
|
|
|
|
|
|
|
COL2ROW and ROW2COL are equivalent to their meanings in QMK.
|
|
|
|
'''
|
|
|
|
|
|
|
|
COLUMNS = 0
|
|
|
|
ROWS = 1
|
|
|
|
COL2ROW = COLUMNS
|
|
|
|
ROW2COL = ROWS
|
|
|
|
|
|
|
|
|
2021-10-03 16:40:18 +02:00
|
|
|
class Scanner:
|
|
|
|
'''
|
|
|
|
Base class for scanners.
|
|
|
|
'''
|
|
|
|
|
2022-04-09 21:34:06 +02:00
|
|
|
coord_mapping = None
|
2022-02-21 02:34:44 +01:00
|
|
|
|
2021-10-03 16:40:18 +02:00
|
|
|
def scan_for_changes(self):
|
|
|
|
'''
|
|
|
|
Scan for key events and return a key report if an event exists.
|
|
|
|
|
|
|
|
The key report is a byte array with contents [row, col, True if pressed else False]
|
|
|
|
'''
|
|
|
|
pass
|