introduce consistent naming scheme
This commit is contained in:
@@ -4,7 +4,7 @@ from kmk.consts import KMK_RELEASE, UnicodeMode
|
||||
from kmk.hid import BLEHID, USBHID, AbstractHID, HIDModes
|
||||
from kmk.keys import KC
|
||||
from kmk.kmktime import ticks_add, ticks_diff
|
||||
from kmk.scanners.native_keypad_scanner import keypad_matrix
|
||||
from kmk.scanners.keypad import MatrixScanner
|
||||
|
||||
|
||||
class Sandbox:
|
||||
@@ -304,7 +304,7 @@ class KMKKeyboard:
|
||||
if self.matrix is None:
|
||||
if self.debug_enabled:
|
||||
print('Initialising default matrix scanner.')
|
||||
self.matrix = keypad_matrix(
|
||||
self.matrix = MatrixScanner(
|
||||
col_pins=self.col_pins,
|
||||
row_pins=self.row_pins,
|
||||
direction=self.diode_orientation,
|
||||
|
@@ -3,7 +3,7 @@ import keypad
|
||||
from kmk.scanners import DiodeOrientation, Scanner
|
||||
|
||||
|
||||
class NativeKeypadScanner(Scanner):
|
||||
class KeypadScanner(Scanner):
|
||||
'''
|
||||
Translation layer around a CircuitPython 7 keypad scanner.
|
||||
|
||||
@@ -39,7 +39,7 @@ class NativeKeypadScanner(Scanner):
|
||||
return ev
|
||||
|
||||
|
||||
def keypad_matrix(row_pins, col_pins, direction=DiodeOrientation.COLUMNS):
|
||||
def MatrixScanner(row_pins, col_pins, direction=DiodeOrientation.COLUMNS):
|
||||
'''
|
||||
Row/Column matrix using the CircuitPython 7 keypad scanner.
|
||||
|
||||
@@ -53,10 +53,10 @@ def keypad_matrix(row_pins, col_pins, direction=DiodeOrientation.COLUMNS):
|
||||
kp = keypad.KeyMatrix(
|
||||
row_pins, col_pins, columns_to_anodes=(direction == DiodeOrientation.COLUMNS)
|
||||
)
|
||||
return NativeKeypadScanner(pin_map, kp)
|
||||
return KeypadScanner(pin_map, kp)
|
||||
|
||||
|
||||
def keys_scanner(pins):
|
||||
def KeysScanner(pins):
|
||||
'''
|
||||
GPIO-per-key 'matrix' using the native CircuitPython 7 keypad scanner.
|
||||
|
||||
@@ -66,4 +66,4 @@ def keys_scanner(pins):
|
||||
kp = keypad.Keys(
|
||||
[pins[r][c] for (r, c) in pin_map], value_when_pressed=False, pull=True
|
||||
)
|
||||
return NativeKeypadScanner(pin_map, kp)
|
||||
return KeypadScanner(pin_map, kp)
|
Reference in New Issue
Block a user