Convert Figma logo to code with AI

KMKfw logokmk_firmware

Clackety Keyboards Powered by Python

1,411
480
1,411
77

Top Related Projects

Open-source keyboard firmware for Atmel AVR and Arm USB families

2,710

ZMK Firmware Repository

A Pro Micro alternative for wireless keyboards

Quick Overview

KMK Firmware is an open-source keyboard firmware written in CircuitPython. It's designed to be user-friendly and customizable, allowing users to create and modify keyboard layouts and functionality without extensive programming knowledge. KMK supports a wide range of keyboards and microcontrollers.

Pros

  • Easy to use and customize, with a gentle learning curve
  • Written in CircuitPython, making it accessible to beginners
  • Supports a wide variety of keyboards and microcontrollers
  • Actively maintained and has a growing community

Cons

  • May have limited advanced features compared to QMK
  • Performance might be slightly slower than compiled firmware
  • Requires CircuitPython-compatible boards
  • Documentation can be sparse for some advanced topics

Code Examples

  1. Basic keymap configuration:
from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC

keyboard = KMKKeyboard()
keyboard.keymap = [
    [KC.A, KC.B, KC.C, KC.D]
]

if __name__ == '__main__':
    keyboard.go()
  1. Adding a layer:
from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC
from kmk.handlers.sequences import simple_key_sequence

keyboard = KMKKeyboard()
keyboard.keymap = [
    [KC.A, KC.B, KC.C, KC.MO(1)],
    [KC.D, KC.E, KC.F, KC.TRNS]
]

if __name__ == '__main__':
    keyboard.go()
  1. Creating a custom macro:
from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC
from kmk.handlers.sequences import simple_key_sequence

keyboard = KMKKeyboard()
MACRO1 = simple_key_sequence([KC.H, KC.E, KC.L, KC.L, KC.O])

keyboard.keymap = [
    [KC.A, KC.B, KC.C, MACRO1]
]

if __name__ == '__main__':
    keyboard.go()

Getting Started

  1. Install CircuitPython on your microcontroller
  2. Clone the KMK repository:
    git clone https://github.com/KMKfw/kmk_firmware.git
    
  3. Copy the kmk folder to your microcontroller
  4. Create a main.py file with your keyboard configuration
  5. Customize your keymap and features as needed
  6. Reset your microcontroller to run the firmware

Competitor Comparisons

Open-source keyboard firmware for Atmel AVR and Arm USB families

Pros of qmk_firmware

  • Larger community and more extensive documentation
  • Supports a wider range of keyboards and microcontrollers
  • More advanced features and customization options

Cons of qmk_firmware

  • Steeper learning curve, especially for beginners
  • Requires C programming knowledge for advanced customization
  • Larger codebase and potentially more complex setup process

Code Comparison

kmk_firmware (Python):

from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC

keyboard = KMKKeyboard()
keyboard.keymap = [
    [KC.A, KC.B, KC.C]
]

qmk_firmware (C):

#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    [0] = LAYOUT(
        KC_A, KC_B, KC_C
    )
};

kmk_firmware uses Python, making it more accessible for beginners and those familiar with Python. qmk_firmware uses C, which offers more low-level control but may be more challenging for some users. The kmk_firmware code is generally more concise and readable, while qmk_firmware provides more flexibility and performance optimizations.

2,710

ZMK Firmware Repository

Pros of ZMK

  • Built specifically for wireless keyboards, offering better power efficiency
  • Supports a wider range of ARM-based microcontrollers
  • More advanced features like split keyboard support and over-the-air updates

Cons of ZMK

  • Steeper learning curve due to its use of Zephyr RTOS
  • Less compatibility with existing CircuitPython boards
  • Requires more setup and configuration for basic functionality

Code Comparison

ZMK configuration (keymap.dtsi):

/ {
    keymap {
        compatible = "zmk,keymap";
        default_layer {
            bindings = <
                &kp Q &kp W &kp E &kp R &kp T
                &kp A &kp S &kp D &kp F &kp G
            >;
        };
    };
};

KMK Firmware configuration (main.py):

from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC

keyboard = KMKKeyboard()
keyboard.keymap = [
    [KC.Q, KC.W, KC.E, KC.R, KC.T,
     KC.A, KC.S, KC.D, KC.F, KC.G]
]

if __name__ == '__main__':
    keyboard.go()

Both projects aim to provide firmware for custom keyboards, but ZMK focuses on wireless functionality and advanced features, while KMK Firmware offers simplicity and easier integration with CircuitPython-compatible boards.

A Pro Micro alternative for wireless keyboards

Pros of nrfmicro

  • Specifically designed for nRF52 microcontrollers, offering Bluetooth Low Energy (BLE) capabilities
  • Includes hardware designs and PCB layouts for custom keyboard builds
  • Provides detailed documentation on assembly and firmware flashing

Cons of nrfmicro

  • Limited to nRF52-based boards, while kmk_firmware supports a wider range of microcontrollers
  • May require more advanced hardware knowledge for implementation
  • Smaller community and fewer resources compared to kmk_firmware

Code Comparison

nrfmicro (config.h):

#define MATRIX_ROWS 4
#define MATRIX_COLS 12
#define DIODE_DIRECTION COL2ROW

kmk_firmware (main.py):

from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC

keyboard = KMKKeyboard()
keyboard.keymap = [
    [KC.A, KC.B, KC.C]
]

The nrfmicro project uses C for configuration, while kmk_firmware uses Python, making it more accessible for beginners. kmk_firmware's approach is more high-level and abstracted, while nrfmicro provides lower-level control over the hardware.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

KMK: Clackety Keyboards Powered by Python

GitHub GitHub contributors Lines of code GitHub issues GitHub closed issues

KMK is a feature-rich and beginner-friendly firmware for computer keyboards written and configured in CircuitPython.

Support

For asynchronous support and chatter about KMK, join our Zulip community!

If you ask for help in chat or open a bug report, if possible make sure your copy of KMK is up-to-date. In particular, swing by the Zulip chat before opening a GitHub Issue about configuration, documentation, etc. concerns.

The former Matrix and Discord rooms once linked to in this README are no longer officially supported, please do not use them!

Features

Getting Started

KMK requires CircuitPython version 7.0 or higher. Our getting started guide can be found here.

Contributing

Please have a look at the contributing document, where you can find details about the workflow and code style. If you have specific questions feel free to ask in the KMK development stream on Zulip.

License, Copyright, and Legal

All software in this repository is licensed under the GNU Public License, version 3. All documentation and hardware designs are licensed under the Creative Commons Attribution-ShareAlike 4.0 license.

Due to ethical and legal concerns, any works derived from GitHub Copilot or similar artificial intelligence tooling are unacceptable for inclusion in any first-party KMK repository or other code collection. We further recommend not using GitHub Copilot while developing anything KMK-related, regardless of intent to submit upstream.