#[non_exhaustive]pub enum Action {
Show 21 variants
No,
Key(KeyCode),
Modifier(ModifierCombination),
KeyWithModifier(HidKeyCode, ModifierCombination),
LayerOn(u8),
LayerOnWithModifier(u8, ModifierCombination),
LayerOff(u8),
LayerToggle(u8),
DefaultLayer(u8),
LayerToggleOnly(u8),
TriLayerLower,
TriLayerUpper,
TriggerMacro(u8),
OneShotLayer(u8),
OneShotModifier(ModifierCombination),
OneShotKey(HidKeyCode),
Light(LightAction),
KeyboardControl(KeyboardAction),
Special(SpecialKey),
User(u8),
PersistentDefaultLayer(u8),
}Expand description
A single basic action that a keyboard can execute.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
No
Default action, no action.
Key(KeyCode)
A normal key stroke, uses for all keycodes defined in KeyCode enum, including mouse key, consumer/system control, etc.
Modifier(ModifierCombination)
Modifier Combination, used in tap hold
KeyWithModifier(HidKeyCode, ModifierCombination)
Key stroke with modifier combination triggered. Modifiers only apply to
HID keyboard keys, so this carries a HidKeyCode rather than a full KeyCode.
LayerOn(u8)
Activate a layer
LayerOnWithModifier(u8, ModifierCombination)
Activate a layer with modifier combination triggered.
LayerOff(u8)
Deactivate a layer
LayerToggle(u8)
Toggle a layer
DefaultLayer(u8)
Set default layer
LayerToggleOnly(u8)
Activate a layer and deactivate all other layers(except default layer)
TriLayerLower
TriLayerUpper
TriggerMacro(u8)
Triggers the Macro at the ‘index’.
OneShotLayer(u8)
Oneshot layer, keep the layer active until the next key is triggered.
OneShotModifier(ModifierCombination)
Oneshot modifier, keep the modifier active until the next key is triggered.
OneShotKey(HidKeyCode)
Oneshot key, keep the key active until the next key is triggered.
Light(LightAction)
Actions for controlling lights
KeyboardControl(KeyboardAction)
Actions for controlling the keyboard
Special(SpecialKey)
Special Keys
User(u8)
User Keys
PersistentDefaultLayer(u8)
Set the default layer and persist it to storage; restored on next boot.
Runtime behavior matches Action::DefaultLayer; additionally persisted to flash.