Event Configuration
RMK allows you to tune event channel parameters in keyboard.toml based on your specific needs and hardware constraints.
For an overview of events and how to define custom events, see the Event documentation.
Configuration Parameters
Each event channel has three configurable parameters:
channel_size: Buffer size - how many events can be queuedpubs: Number of publishers - how many concurrent tasks can publishsubs: Number of subscribers - how many concurrent tasks can subscribe
Each event has default values for typical use cases. You can view all defaults in rmk-config/src/default_config/event_default.toml.
The subs values are base counts. When a Cargo feature is enabled, RMK adds the subscribers its own tasks need on top of subs, whether the value comes from the defaults or from your [event.<name>] entry. For example, the internal _ble feature (enabled by every BLE chip feature) adds 1 to keyboard and pointing, split adds 2 to led_indicator, and display adds 1 to wpm_update, modifier, sleep_state, layer_change, battery_status and led_indicator. The full list of bumps is in rmk-config/src/default_config/subscriber_default.toml. If you add your own subscribers, raise subs from its default by that number; you don't need to count the feature-gated built-in subscribers.
Configuration Syntax
Add an [event] section to your keyboard.toml:
Examples:
Configurable Event Names
Unlisted parameters default to 1. The subs values are base counts before the feature bumps described above.
Related Documentation
- Event - Event concepts, built-in events, and custom event definition
- Input Device - How to create input devices that publish events
- Processor - How to create processors that subscribe to events