Skip to content

Commit

Permalink
Fix scanners.md (#1058)
Browse files Browse the repository at this point in the history
* Fix scanners.md
* Fix affected boards
  • Loading branch information
regicidalplutophage authored Dec 16, 2024
1 parent 9271a9a commit b638cc5
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion boards/a_dux/kb.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ class KMKKeyboard(_KMKKeyboard):

def __init__(self):
# create and register the scanner
self.matrix = KeysScanner(_KEY_CFG_LEFT)
self.matrix = KeysScanner(_KEY_CFG_LEFT, value_when_pressed=False)
5 changes: 4 additions & 1 deletion boards/anavi/anavi-arrows/arrows.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ class AnaviArrows(KMKKeyboard):
'''

def __init__(self):
self.matrix = KeysScanner([board.D1, board.D2, board.D3, board.D6])
self.matrix = KeysScanner(
[board.D1, board.D2, board.D3, board.D6],
value_when_pressed=False,
)
2 changes: 1 addition & 1 deletion boards/anavi/knob1/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kmk.scanners.keypad import KeysScanner

knob = KMKKeyboard()
knob.matrix = KeysScanner([])
knob.matrix = KeysScanner([], value_when_pressed=False)

media_keys = MediaKeys()
knob.extensions.append(media_keys)
Expand Down
2 changes: 1 addition & 1 deletion boards/anavi/knobs3/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kmk.scanners.keypad import KeysScanner

knob = KMKKeyboard()
knob.matrix = KeysScanner([])
knob.matrix = KeysScanner([], value_when_pressed=False)

media_keys = MediaKeys()
knob.extensions.append(media_keys)
Expand Down
5 changes: 4 additions & 1 deletion boards/budgy/kb.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
class KMKKeyboard(_KMKKeyboard):
def __init__(self):
# create and register the scanner
self.matrix = KeysScanner(pins=_KEY_CFG_RIGHT if isRight else _KEY_CFG_LEFT)
self.matrix = KeysScanner(
pins=_KEY_CFG_RIGHT if isRight else _KEY_CFG_LEFT,
value_when_pressed=False,
)

# fmt: off
coord_mapping = [
Expand Down
2 changes: 1 addition & 1 deletion boards/ferris_sweep/kb.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class KMKKeyboard(_KMKKeyboard):
def __init__(self):
# create and register the scanner
self.matrix = KeysScanner(_KEY_CFG_LEFT)
self.matrix = KeysScanner(_KEY_CFG_LEFT, value_when_pressed=False)

# fmt: off
coord_mapping = [
Expand Down
2 changes: 1 addition & 1 deletion boards/isopad/kb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
class KMKKeyboard(_KMKeyboard):
def __init__(self):
# create and register the scanner
self.matrix = KeysScanner(_KEY_CFG)
self.matrix = KeysScanner(_KEY_CFG, value_when_pressed=False)
2 changes: 1 addition & 1 deletion boards/pimoroni/keybow/keybow.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ class Keybow(KMKKeyboard):
extensions = [rgb]

def __init__(self):
self.matrix = KeysScanner(_KEY_CFG)
self.matrix = KeysScanner(_KEY_CFG, value_when_pressed=False)
2 changes: 1 addition & 1 deletion boards/pimoroni/keybow_2040/keybow_2040.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ class Keybow2040(KMKKeyboard):
'''

def __init__(self):
self.matrix = KeysScanner(_KEY_CFG)
self.matrix = KeysScanner(_KEY_CFG, value_when_pressed=False)
4 changes: 2 additions & 2 deletions docs/en/scanners.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ class MyKeyboard(KMKKeyboard):
self.matrix = KeysScanner(
# require argument:
pins=_KEY_CFG,
# optional arguments with defaults:
value_when_pressed=False,
# optional arguments with defaults:
pull=True,
interval=0.02, # Matrix sampling interval in ms
debounce_threshold=None, # Number of samples needed to change state, values greater than 1 enable debouncing. Only applicable for CircuitPython >= 9.2.0
Expand All @@ -97,9 +97,9 @@ class MyKeyboard(KMKKeyboard):
data=board.GP1,
latch=board.GP2,
key_count=8,
value_when_pressed=False,
# optional arguments with defaults:
value_to_latch=True, # 74HC165: True, CD4021: False
value_when_pressed=False,
interval=0.02, # Matrix sampling interval in ms
debounce_threshold=None, # Number of samples needed to change state, values greater than 1 enable debouncing. Only applicable for CircuitPython >= 9.2.0
max_events=64
Expand Down

0 comments on commit b638cc5

Please sign in to comment.