Custom matrix scanners

- Introduce Scanner base class for MatrixScanner
- Create new Scanner using built-in keypad module
- Allow overriding the scanner used by KMKKeyboard
This commit is contained in:
Ellie
2021-10-04 01:40:18 +11:00
committed by Kyle Brown
parent e7d306cf30
commit 57ba0fe8b2
5 changed files with 153 additions and 7 deletions

View File

@@ -1,5 +1,7 @@
import digitalio
from kmk.scanners import Scanner
def intify_coordinate(row, col, len_cols):
return len_cols * row + col
@@ -26,7 +28,7 @@ class KeyEvent:
self.pressed = pressed
class MatrixScanner:
class MatrixScanner(Scanner):
def __init__(
self,
cols,