Configuration

RMK provides a simple and declarative way to configure your keyboard using a TOML configuration file, requiring no Rust programming knowledge. You can also use Rust API which offers maximum flexibility and control over your keyboard's behavior.

In this section, we will introduce how to configure your keyboard using both the keyboard.toml file and Rust code. Generally, the configuration code is presented in the following format, allowing you to easily switch between using the TOML configuration or the Rust code configuration:

Toml
Rust
keyboard.toml
[keyboard]
name = "RMK Keyboard"
product_name = "RMK Keyboard"
vendor_id = 0x4c4b
product_id = 0x4643
manufacturer = "haobo"

keyboard.toml

The keyboard.toml file is the central configuration for nearly every aspect of your keyboard setup. The following sections can be configured in your keyboard.toml:

  • Keyboard and Matrix - Basic keyboard information and physical key matrix definition
  • Layout - Keyboard layout and default keymap configuration
  • Split Keyboard - Configuration for split keyboard setups
  • Storage - On-board configuration and keymap storage settings
  • Behavior - Advanced keyboard behaviors (one-shot keys, tri-layer, tap-hold, morse key, home row mods, etc.)
  • Input Devices - Configuration for rotary encoders, joysticks, and other input devices
  • Wireless/Bluetooth - Wireless and Bluetooth connectivity settings
  • Lighting - RGB lighting and LED configuration
  • RMK Config - Internal RMK settings (communication channels, macro limits, etc.)
  • Complete Reference - Full specification and examples for keyboard.toml

We also provide pre-configured templates for popular microcontroller chips in the rmk-config/src/default_config directory. You can use then when generating project using rmkit. Contributions for additional chip configurations are welcome!

For a complete specification of all TOML configuration options, please refer to the other documentation chapters under Configuration section.

Rust API

All Rust API that RMK provides can be found in https://docs.rs/rmk, you can also refer to examples/use_rust in RMK's main repository for comprehensive examples.