Fix a minor typo in the getting started page. Signed-off-by: Leon Anavi <leon@anavi.org>
5.1 KiB
Getting Started
Life was like a box of chocolates. You never know what you're gonna get.
KMK is a keyboard focused layer that sits on top of CircuitPython. As such, it should work with most boards that support CircuitPython. It is best to use the last stable version (>5.0). Known working and recommended devices can be found here
We are also providing a keyboard optimized version of CircuitPython (simplified to cope with memory limits of certain boards and with a selection of preinstalled relevant modules). If you're wondering why use KMKPython rather than barebone CircuitPython, we tried to compare both approaches here
TL;DR Quick start guide
To infinity and beyond!
- Install CircuitPython on your board. With most boards, it should be as easy as drag and dropping the firmware on the drive
- Get a copy of KMK from the master branch
- Unzip it and copy the KMK folder and the boot.py file at the root of the USB drive corresponding to your board (often appearing as CIRCUITPY)
- Create a new code.py or main.py file in the same root directory (same level as boot.py) with the example content hereunder:
IMPORTANT: adapt the GP0 / GP1 pins to your specific board !
print("Starting")
import board
from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC
from kmk.matrix import DiodeOrientation
keyboard = KMKKeyboard()
keyboard.col_pins = (board.GP0,)
keyboard.row_pins = (board.GP1,)
keyboard.diode_orientation = DiodeOrientation.COL2ROW
keyboard.keymap = [
[KC.A,]
]
if __name__ == '__main__':
keyboard.go()
-
With a wire / paperclip / whatever, connect GPIO 0 & GPIO 1 together (or the pins you chose for your boards)
-
If it prints a "A" (or a "Q" or ... depending on your keyboard layout), you're done!
Now that you're up and running, you may want to go further...
This is your last chance. After this, there is no turning back. You take the blue pill—the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill—you stay in Wonderland, and I show you how deep the rabbit hole goes. Remember: all I'm offering is the truth. Nothing more.
You're extremely lucky and you have a fully supported keyboard
If your keyboard and microcontroller are officially supported, simply visit the page for your files, and dropping them on the root of the "flash drive". Those pages can be found here. You will need the kb.py
and main.py
. More advanced instructions can be found here.
Please note that we recommend using KMKPython for these boards as it is optimized for them. If using Circuitpython and NOT KMKPython, you will also need boot.py
You've got another, maybe DIY, board and want to customise KMK for it
First, be sure to understand how your device work, and particularly its specific matrix configuration. You can have a look here or read the guide provided by the QMK team for handwired keyboards
Once you've got the gist of it:
- You can have a look here and here to start customizing your code.py / main.py file
- There's a reference of the available keycodes
- International extension adds keys for non US layouts and Media Keys adds keys for ... media
And to go even further:
- Sequences are used for sending multiple keystrokes in a single action
- Layers can transform the whole way your keyboard is behaving with a single touch
- ModTap allow you to customize the way a key behaves wether it is tapped or hold, and TapDance depending on the number of times it is pressed
Want to have fun features such as RGB, split keyboards and more? Check out what builtin modules and extensions can do! You can also get ideas from the various user examples that we provide and dig into our documentation
Additional help and support
Roads? Where we're going we don't need roads.
In case you need it, debugging help can be found here
If you need support with KMK or just want to say hi, find us in
#kmkfw:klar.sh on Matrix. This channel is
bridged to Discord here
for convenience. If you ask for help on chat or open a bug report, if possible
please give us your commit SHA, found by running
from kmk.consts import KMK_RELEASE; print(KMK_RELEASE)
in the REPL on your
controller.