Skip to content

Commit 1c293c4

Browse files
authored
Merge pull request #2097 from adafruit/maypad-fix
Fixed maypad code
2 parents 9c3a230 + df9d62c commit 1c293c4

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

may_pad/main.py

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,33 @@
11
# SPDX-FileCopyrightText: 2022 Eva Herrada for Adafruit Industries
22
# SPDX-License-Identifier: MIT
33

4-
import board
5-
6-
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
7-
from kmk.matrix import DiodeOrientation
8-
9-
10-
class KMKKeyboard(_KMKKeyboard):
11-
row_pins = (board.D5, board.D6, board.D7, board.D8, board.D9)
12-
col_pins = (
13-
board.A1,
14-
board.A0,
15-
board.SCK,
16-
board.MISO,
17-
)
18-
diode_orientation = DiodeOrientation.COLUMNS
19-
i2c = board.I2C
4+
from kb import KMKKeyboard
5+
6+
from kmk.extensions.media_keys import MediaKeys
7+
from kmk.keys import KC
8+
from kmk.modules.layers import Layers
9+
10+
keyboard = KMKKeyboard()
11+
12+
media = MediaKeys()
13+
layers_ext = Layers()
14+
15+
keyboard.extensions = [media]
16+
keyboard.modules = [layers_ext]
17+
18+
# Cleaner key names
19+
_______ = KC.TRNS
20+
XXXXXXX = KC.NO
21+
22+
keyboard.keymap = [
23+
[
24+
KC.NLCK, KC.PSLS, KC.PAST, KC.PMNS,
25+
KC.P7, KC.P8, KC.P9, _______,
26+
KC.P4, KC.P5, KC.P6, KC.PPLS,
27+
KC.P1, KC.P2, KC.P3, _______,
28+
_______, KC.P0, KC.PDOT, KC.PENT,
29+
]
30+
]
31+
32+
if __name__ == '__main__':
33+
keyboard.go()

0 commit comments

Comments
 (0)