pub enum KeyAction {
No,
Transparent,
Single(Action),
Tap(Action),
TapHold(Action, Action, MorseProfile),
Morse(u8),
}Expand description
A KeyAction is the action at a keyboard position, stored in keymap. It can be a single action like triggering a key, or a composite keyboard action like tap/hold
Variants§
No
No action. Serialized as 0x0000.
Transparent
Transparent action, next layer will be checked. Serialized as 0x0001.
Single(Action)
A single action, such as triggering a key, or activating a layer. Action is triggered when pressed and cancelled when released.
Tap(Action)
Don’t wait the release of the key, auto-release after a time threshold.
TapHold(Action, Action, MorseProfile)
Tap hold action
Morse(u8)
Morse action, references a morse configuration by index.
Implementations§
Source§impl KeyAction
impl KeyAction
Sourcepub fn to_action(self) -> Action
pub fn to_action(self) -> Action
Convert KeyAction to the internal Action.
Only valid for Single and Tap variant, returns Action::No for other variants.
Sourcepub fn is_morse(&self) -> bool
pub fn is_morse(&self) -> bool
‘morse’ is an alias for the superset of tap dance and tap hold keys, since their handling have many similarities
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for KeyAction
impl<'de> Deserialize<'de> for KeyAction
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 KeyAction
impl MaxSize for KeyAction
Source§const POSTCARD_MAX_SIZE: usize = 14usize
const POSTCARD_MAX_SIZE: usize = 14usize
Source§impl PartialEq for KeyAction
combo, fork, etc. compares key actions
WARNING: this is not a perfect comparison, we ignores the profile config of TapHold!
impl PartialEq for KeyAction
combo, fork, etc. compares key actions WARNING: this is not a perfect comparison, we ignores the profile config of TapHold!
impl Copy for KeyAction
impl Eq for KeyAction
Auto Trait Implementations§
impl Freeze for KeyAction
impl RefUnwindSafe for KeyAction
impl Send for KeyAction
impl Sync for KeyAction
impl Unpin for KeyAction
impl UnwindSafe for KeyAction
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)