77# * This matrix is different than the (more common) Commodore 64 matrix
88# * There are no diodes, not even on modifiers, so there's only 2-key rollover.
99
10- from board import *
11- import keypad
1210import asyncio .core
11+ from board import * # pylint: disable=wildcard-import,unused-wildcard-import
12+ import keypad
1313from adafruit_hid .keycode import Keycode as K
1414from adafruit_hid .keyboard import Keyboard
1515import usb_hid
1616
1717# True to use a more POSITIONAL mapping, False to use a more PC-style mapping
1818POSITIONAL = True
1919
20- # Keyboard schematic https://archive.org/details/SAMS_Computerfacts_Commodore_C16_1984-12_Howard_W_Sams_Co_CC8/page/n9/mode/2up
20+ # Keyboard schematic from
21+ # https://archive.org/details/SAMS_Computerfacts_Commodore_C16_1984-12_Howard_W_Sams_Co_CC8/page/n9/mode/2up
2122# 1 3 6 7 8 9 10 11 12 13 14 15 16 17 18 19 # connector pins
2223# R5 C7 R7 C4 R1 C5 C6 R3 R2 R4 C2 C1 R6 C3 C0 R0 # row/column in schematic
2324# D2 D3 D4 D5 D6 D7 D8 D9 D10 MOSI MISO SCK A0 A1 A2 A3 # conencted to kb2040 at
@@ -161,7 +162,6 @@ def __init__(self, rollover=2):
161162 self ._ghost = [0 ] * 64
162163
163164 def __call__ (self , event ):
164- old_count = self ._count
165165 self ._ghost [event .key_number ] = event .pressed
166166 if event .pressed :
167167 if self ._count < self ._rollover :
@@ -181,7 +181,7 @@ async def key_task():
181181
182182 with keypad .KeyMatrix (rows , cols ) as keys , AsyncEventQueue (keys .events ) as q :
183183 while True :
184- ev = await q
184+ ev = await q
185185 for ev in twokey_filter (ev ):
186186 keycode = keycodes [ev .key_number ]
187187 if callable (keycode ):
0 commit comments