Module keycode
Expand description
Key action and keycode definitions.
A key is represented by a three-layer structure: KeyAction
→ KeyCode
→ Key
.
For example, a key action that sends A on Tap and Shift on Hold could be defined as follows
const ACTION: KeyAction = KeyAction::TapHold(KeyCode::Key(Key::A),
KeyCode::Modifier(Modifier::LShft));
This hierarchical structure allows any key to be used for any action. For example, QMK only allows Mod-Tap and Layer-Tap as TapHolds. However, it requires more bytes to represent one key.
For convenience, keycodes are defined as constants with normal keyaction like this:
const A: KeyAction = KeyAction::Normal(KeyCode::Key(Key::A));
You can use these constants to define keymap.
Modules§
- key
- Normal keys
- layer
- Layer operation keys
- media
- Media keys.
- modifier
- Modifier keys
- mouse
- prelude
- Convenient prelude of keycodes for defining keymaps
- special
- Special keys.
- utils
- Utility functions to define keymap.