pub struct Key<R> {
pub base: R,
pub morphed: R,
pub trigger_mods: KeyboardModifiers,
pub keep_mods: KeyboardModifiers,
}Expand description
A key that picks a nested binding based on held modifiers.
Fields§
§base: RBinding used when none of Self::trigger_mods are held.
morphed: RBinding used when any of Self::trigger_mods is held.
trigger_mods: KeyboardModifiersModifiers that activate the morphed binding (any-of).
keep_mods: KeyboardModifiersSubset of Self::trigger_mods to keep in the report on the morph path.
Implementations§
Source§impl<R> Key<R>
impl<R> Key<R>
Sourcepub const fn new(
base: R,
morphed: R,
trigger_mods: KeyboardModifiers,
keep_mods: KeyboardModifiers,
) -> Key<R>
pub const fn new( base: R, morphed: R, trigger_mods: KeyboardModifiers, keep_mods: KeyboardModifiers, ) -> Key<R>
Constructs a mod-conditioned key.
Sourcepub const fn suppress_mods(&self) -> KeyboardModifiers
pub const fn suppress_mods(&self) -> KeyboardModifiers
Mods to suppress on the morph path (trigger \ keep).
Trait Implementations§
Source§impl<'de, R> Deserialize<'de> for Key<R>where
R: Deserialize<'de>,
impl<'de, R> Deserialize<'de> for Key<R>where
R: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Key<R>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Key<R>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<R> Copy for Key<R>where
R: Copy,
impl<R> StructuralPartialEq for Key<R>
Auto Trait Implementations§
impl<R> Freeze for Key<R>where
R: Freeze,
impl<R> RefUnwindSafe for Key<R>where
R: RefUnwindSafe,
impl<R> Send for Key<R>where
R: Send,
impl<R> Sync for Key<R>where
R: Sync,
impl<R> Unpin for Key<R>where
R: Unpin,
impl<R> UnsafeUnpin for Key<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Key<R>where
R: 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