Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Firmware/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
from kmk.keys import KC
from kmk.modules.macros import Macros
from kmk.handlers.sequences import simple_key_sequence
+from kmk.scanners.keypad import KeysScanner
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix the invalid syntax on the KeysScanner import.

Ruff reports invalid syntax at Line 6. Ensure there’s no stray leading character (e.g., a + diff marker) before the from statement in the committed file.

🛠️ Proposed fix
-+from kmk.scanners.keypad import KeysScanner
+from kmk.scanners.keypad import KeysScanner
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
+from kmk.scanners.keypad import KeysScanner
from kmk.scanners.keypad import KeysScanner
🧰 Tools
🪛 Ruff (0.14.14)

[warning] 6-6: Expected an identifier, but found a keyword from that cannot be used here

(invalid-syntax)


[warning] 6-6: Simple statements must be separated by newlines or semicolons

(invalid-syntax)


[warning] 6-6: Simple statements must be separated by newlines or semicolons

(invalid-syntax)

🤖 Prompt for AI Agents
In `@Firmware/main.py` at line 6, Remove the stray diff marker causing the syntax
error by fixing the import line in main.py: replace the invalid line that
contains "+from kmk.scanners.keypad import KeysScanner" with a proper Python
import "from kmk.scanners.keypad import KeysScanner" so the KeysScanner symbol
is imported without the leading '+' character.


keyboard = KMKKeyboard()

macros = Macros()
keyboard.modules.append(macros)

keyboard.row_pins = (board.GP0, board.GP2) # Bottom row: SW2, SW4, SW6
keyboard.col_pins = (board.GP7, board.GP1, board.GP4) # Top row: SW1, SW3, SW5
keyboard.diode_orientation = keyboard.DIODE_COL2ROW

PINS = [board.SCL, board.TX, board.RX, board.SCK, board.MISO, board.MOSI]
keyboard.matrix = KeysScanner(pins=PINS, value_when_pressed=False)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
# Mac shortcuts
CMD_H = simple_key_sequence((KC.LCMD, KC.H))
CMD_W = simple_key_sequence((KC.LCMD, KC.W))
Expand Down