pub enum ModifierKey {
Hold(LayerIndex),
}
Expand description
Modifier layer key affects what layers are active.
Variants§
Hold(LayerIndex)
Activates the given layer when the held.
Implementations§
Source§impl ModifierKey
impl ModifierKey
Sourcepub fn new_pressed_key(&self) -> (PressedModifierKeyState, LayerEvent)
pub fn new_pressed_key(&self) -> (PressedModifierKeyState, LayerEvent)
Create a new input::PressedKey and key::ScheduledEvent for the given keymap index.
Pressing a ModifierKey::Hold emits a LayerEvent::LayerActivated event.
Trait Implementations§
Source§impl Clone for ModifierKey
impl Clone for ModifierKey
Source§fn clone(&self) -> ModifierKey
fn clone(&self) -> ModifierKey
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ModifierKey
impl Debug for ModifierKey
Source§impl<'de> Deserialize<'de> for ModifierKey
impl<'de> Deserialize<'de> for ModifierKey
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ModifierKey> for BaseKey
impl From<ModifierKey> for BaseKey
Source§fn from(key: ModifierKey) -> Self
fn from(key: ModifierKey) -> Self
Converts to this type from the input type.
Source§impl Key for ModifierKey
impl Key for ModifierKey
Source§type Context = Context
type Context = Context
The associated Context is used to provide state that
may affect behaviour when pressing the key.
(e.g. the behaviour of layered::LayeredKey depends on which
layers are active in layered::Context).
Source§type PressedKey = PressedKey<BaseKey, BasePressedKeyState>
type PressedKey = PressedKey<BaseKey, BasePressedKeyState>
The associated PressedKeyState implements functionality
for the pressed key.
(e.g. tap_hold::PressedKeyState implements behaviour resolving
the pressed tap hold key as either ‘tap’ or ‘hold’).
Source§fn new_pressed_key(
&self,
_context: Self::Context,
keymap_index: u16,
) -> (Self::PressedKey, PressedKeyEvents<Self::Event>)
fn new_pressed_key( &self, _context: Self::Context, keymap_index: u16, ) -> (Self::PressedKey, PressedKeyEvents<Self::Event>)
Key::new_pressed_key produces a pressed key value, and may
yield some ScheduledEvents.
(e.g. tap_hold::Key schedules a tap_hold::Event::TapHoldTimeout
so that holding the key resolves as a hold).
Source§impl PartialEq for ModifierKey
impl PartialEq for ModifierKey
impl Copy for ModifierKey
impl StructuralPartialEq for ModifierKey
impl TapHoldNestable for ModifierKey
Auto Trait Implementations§
impl Freeze for ModifierKey
impl RefUnwindSafe for ModifierKey
impl Send for ModifierKey
impl Sync for ModifierKey
impl Unpin for ModifierKey
impl UnwindSafe for ModifierKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more