Rust Keyboard Toolkit
rktk is a keyboard firmware framework written in Rust.
Currently, rktk supports nRF52840 and RP2040, and although there are bugs and performance issues (especially related to split keyboards), it can be used as a decent keyboard.
This firmware consists of two parts: the core functionality implemented in the
rktk
crate and the driver that actually interacts with the hardware. This
makes it easy to extend.
Crate | crates.io | docs.rs | repo |
---|---|---|---|
rktk | link | ||
rktk-drivers-common | link | ||
rktk-drivers-nrf | link | ||
rktk-drivers-rp | link | ||
rktk-keymanager | link | ||
rktk-rrp | link | ||
rktk-rrp-client-webhid | link | ||
rktk-client | link |
- β : Working
- π‘ : Basic implementation only or known bugs.
- π΄ : Planned.
- (blank): N/A.
Feature | Status | Note |
---|---|---|
Keyscan | β | |
Key mapping | π‘ | See below table for detail |
Mouse | β | |
Encoder | π‘ | |
Hook system | π‘ | |
USB | β | |
Bluetooth | π‘ | |
Split keyboard | β | |
Display | π‘ | |
Storage | π‘ | |
RGB led | π‘ | |
Remapper (rktk-client) | π‘ |
Key mapping features is implemented in rktk-keymanager
and this crate does not
depend on rktk or embassy.
Feature name | Status | Note |
---|---|---|
Key action | ||
Tap-Hold | β | Called as Mod-Tap or Layer-Tap in QMK |
Tap Dance | β | |
Oneshot key | β | |
Combo key | π‘ | |
Key code | ||
Normal key | β | |
Modifier key | β | |
Media key | β | |
Mouse key | β | |
Mouse scroll momentary | β | |
Layer momentary (MO) | β | |
Layer toggle (TG) | β |
Driver that is available in the rktk-drivers-common
crate is available for all
platforms which have embassy compatible HAL.
Driver | Common | RP2040 | NRF52840 |
---|---|---|---|
Key scanner | |||
Matrix | π‘ | - | - |
Matrix with shift register | β | - | - |
(Japanese) Duplex-Matrix | π‘ | - | - |
Mouse | |||
PMW3360 | β | - | - |
PAW3395 | β | - | - |
Encoder | π‘ | - | - |
Debouncer | |||
Eager debouncer | π‘ | - | - |
Host communication | |||
USB | β | - | - |
Bluetooth | π‘ (SoftDevice) | ||
Split communication | |||
Half-duplex (single wire, TRS) | π‘ (PIO) | π‘ (UART) | |
Full-duplex (dual wire, TRRS) | β (UART) | ||
Bluetooth | π΄ | ||
Display | |||
SSD1306 | β | - | - |
Storage | |||
sequential-storage (NorFlash) | π‘ | - | - |
RGB led | |||
WS2812 | β (PIO) | β (PWM) |
You can find examples in the examples
directory.
rust-objcopy
is required to generate uf2 file.
rktk actually doesn't depends on nightly feature of rustc, but uses nightly
cargo features like per-package-target
. So, it requires nightly toolchain.
Currently, there is no guide for building a new keyboard, but you can refer to the examples in this repo or the following repository:
- rumcake: RP2040 double-tap-reset driver
- uf2: uf2conv.py, uf2families.json
- rust-dilemma: RP2040 Half-duplex communication
- qmk: RP2040 Half-duplex communication
- rmk: bluetooth implemention