Last active
June 4, 2022 19:30
-
-
Save andywarburton/536f8f7aab50e27b959eca0fcadde697 to your computer and use it in GitHub Desktop.
KMK Firmware for my 40% One Handed Keyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Starting") | |
import board | |
import neopixel | |
from kmk.kmk_keyboard import KMKKeyboard | |
from kmk.keys import KC | |
from kmk.scanners import DiodeOrientation | |
from kmk.scanners import intify_coordinate as ic | |
from kmk.extensions.RGB import RGB | |
from kmk.handlers.sequences import send_string | |
from kmk.modules.tapdance import TapDance | |
keyboard = KMKKeyboard() | |
keyboard.debug_enabled = True | |
tapdance = TapDance() | |
tapdance.tap_time = 5000 | |
keyboard.modules.append(tapdance) | |
# print(dir(board)) | |
rgb_pixel_pin = board.D13 | |
rgb_ext = RGB( | |
pixel_pin=rgb_pixel_pin, | |
num_pixels=194, | |
) | |
keyboard.extensions.append(rgb_ext) | |
keyboard.col_pins = (board.A0, board.A1, board.A2, board.A3, board.D24, board.D25, board.SCK, board.MOSI) | |
keyboard.row_pins = (board.D9, board.D6, board.D5, board.SCL, board.SDA) # try D6 on Feather, keeboar | |
keyboard.diode_orientation = DiodeOrientation.COL2ROW | |
coord_mapping = [ | |
0, 1, 2, 3, 4, 5, 6, 7 | |
] | |
LED_TD = KC.TD( | |
KC.RGB_MODE_PLAIN, | |
KC.RGB_MODE_BREATHE, | |
KC.RGB_MODE_RAINBOW, | |
KC.RGB_MODE_BREATHE_RAINBOW, | |
KC.RGB_MODE_KNIGHT, | |
KC.RGB_MODE_SWIRL, | |
KC.RGB_TOG | |
) | |
# keymap | |
keyboard.keymap = [ | |
[ | |
KC.ESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, LED_TD, | |
KC.NO, KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, | |
KC.NO, KC.NO , KC.CAPS, KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, | |
KC.NO, KC.LSHIFT, KC.Z, KC.X, KC.C, KC.V, KC.B, KC.UP, KC.RIGHT, | |
KC.LCTRL, KC.LALT, KC.LGUI, KC.TRNS, KC.SPACE, KC.LEFT, KC.NO, KC.DOWN | |
] | |
] | |
# keymap | |
# WORKING KEYMAP FOR REFERENCE | |
# keyboard.keymap = [ | |
# [ | |
# KC.ESC, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.RGB_TOG, | |
# ooo, KC.TAB, KC.Q, KC.W, KC.E, KC.R, KC.T, | |
# ooo, ooo, KC.CAPS, KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, | |
# ooo, KC.LSHIFT, KC.Z, KC.X, KC.C, KC.V, KC.B, KC.UP, KC.RIGHT, | |
# KC.LCTRL, KC.LALT, KC.LGUI, KC.TRNS, KC.SPACE, KC.LEFT, ooo, KC.DOWN | |
# ] | |
# ]12345qqqwweerrtthhasdfdsfghZxxccccvvbbbb | |
if __name__ == '__main__': | |
keyboard.go() |
daysgobye
commented
Jun 4, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment