pub struct TapHold<K: TapHoldNestable>(pub K);
Expand description
Newtype for TapHoldNestable keys so they can implement key::Key for TapHoldPressedKey.
Tuple Fields§
§0: K
Implementations§
Source§impl<K: TapHoldNestable> TapHold<K>
impl<K: TapHoldNestable> TapHold<K>
Sourcepub fn as_fat_key(self) -> TapHoldKey<BaseKey>
pub fn as_fat_key(self) -> TapHoldKey<BaseKey>
Constructs a ‘fat’ key value from the given tap hold key.
Source§impl TapHold<ModifierKey>
impl TapHold<ModifierKey>
Sourcepub const fn layer_modifier(key: ModifierKey) -> Self
pub const fn layer_modifier(key: ModifierKey) -> Self
Constructs a TapHold newtypefrom the given key.
Trait Implementations§
Source§impl<K: TapHoldNestable> Key for TapHold<K>
impl<K: TapHoldNestable> Key for TapHold<K>
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<TapHoldKey<BaseKey>, TapHoldPressedKeyState<BaseKey>>
type PressedKey = PressedKey<TapHoldKey<BaseKey>, TapHoldPressedKeyState<BaseKey>>
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<K: TapHoldNestable> LayeredNestable for TapHold<K>
impl<K: TapHoldNestable> LayeredNestable for TapHold<K>
Source§fn as_fat_key(self) -> TapHoldKey<BaseKey>
fn as_fat_key(self) -> TapHoldKey<BaseKey>
Construct a ‘full representation’ of the nestable key.
impl<K: Copy + TapHoldNestable> Copy for TapHold<K>
impl<K: TapHoldNestable> StructuralPartialEq for TapHold<K>
Auto Trait Implementations§
impl<K> Freeze for TapHold<K>where
K: Freeze,
impl<K> RefUnwindSafe for TapHold<K>where
K: RefUnwindSafe,
impl<K> Send for TapHold<K>where
K: Send,
impl<K> Sync for TapHold<K>where
K: Sync,
impl<K> Unpin for TapHold<K>where
K: Unpin,
impl<K> UnwindSafe for TapHold<K>where
K: UnwindSafe,
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