Fixed maypad code
This commit is contained in:
parent
acefa00561
commit
df9d62c0b7
1 changed files with 27 additions and 13 deletions
|
|
@ -1,19 +1,33 @@
|
|||
# SPDX-FileCopyrightText: 2022 Eva Herrada for Adafruit Industries
|
||||
# SPDX-License-Identifier: MIT
|
||||
|
||||
import board
|
||||
from kb import KMKKeyboard
|
||||
|
||||
from kmk.kmk_keyboard import KMKKeyboard as _KMKKeyboard
|
||||
from kmk.matrix import DiodeOrientation
|
||||
from kmk.extensions.media_keys import MediaKeys
|
||||
from kmk.keys import KC
|
||||
from kmk.modules.layers import Layers
|
||||
|
||||
keyboard = KMKKeyboard()
|
||||
|
||||
class KMKKeyboard(_KMKKeyboard):
|
||||
row_pins = (board.D5, board.D6, board.D7, board.D8, board.D9)
|
||||
col_pins = (
|
||||
board.A1,
|
||||
board.A0,
|
||||
board.SCK,
|
||||
board.MISO,
|
||||
)
|
||||
diode_orientation = DiodeOrientation.COLUMNS
|
||||
i2c = board.I2C
|
||||
media = MediaKeys()
|
||||
layers_ext = Layers()
|
||||
|
||||
keyboard.extensions = [media]
|
||||
keyboard.modules = [layers_ext]
|
||||
|
||||
# Cleaner key names
|
||||
_______ = KC.TRNS
|
||||
XXXXXXX = KC.NO
|
||||
|
||||
keyboard.keymap = [
|
||||
[
|
||||
KC.NLCK, KC.PSLS, KC.PAST, KC.PMNS,
|
||||
KC.P7, KC.P8, KC.P9, _______,
|
||||
KC.P4, KC.P5, KC.P6, KC.PPLS,
|
||||
KC.P1, KC.P2, KC.P3, _______,
|
||||
_______, KC.P0, KC.PDOT, KC.PENT,
|
||||
]
|
||||
]
|
||||
|
||||
if __name__ == '__main__':
|
||||
keyboard.go()
|
||||
|
|
|
|||
Loading…
Reference in a new issue