pub enum Action {
Show 15 variants
No,
Transparent,
Key(KeyCode),
Modifier(ModifierCombination),
KeyWithModifier(KeyCode, ModifierCombination),
LayerOn(u8),
LayerOnWithModifier(u8, ModifierCombination),
LayerOff(u8),
LayerToggle(u8),
DefaultLayer(u8),
LayerToggleOnly(u8),
TriggerMacro(u8),
OneShotLayer(u8),
OneShotModifier(ModifierCombination),
OneShotKey(KeyCode),
}Expand description
A single basic action that a keyboard can execute.
Variants§
No
Default action, no action.
Transparent
Transparent action, next layer will be checked.
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 for oneshot keyaction.
KeyWithModifier(KeyCode, ModifierCombination)
Key stroke with modifier combination triggered.
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)
TriggerMacro(u8)
Triggers the Macro at the ‘index’.
this is an alternative trigger to
Macro keycodes (0x500 ~ 0x5FF; KeyCode::Macro0 ~ KeyCode::Macro31
e.g. Action::TriggerMacro(6)`` will trigger the same Macro as Action::Key(KeyCode::Macro6)`
the main purpose for this enum variant is to easily extend to more than 32 macros (to 256)
without introducing new Keycodes.
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(KeyCode)
Oneshot key, keep the key active until the next key is triggered.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl MaxSize for Action
impl MaxSize for Action
Source§const POSTCARD_MAX_SIZE: usize = 4usize
const POSTCARD_MAX_SIZE: usize = 4usize
impl Copy for Action
impl Eq for Action
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnwindSafe for Action
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)