pub struct LayeredKey<K: Key + Copy + PartialEq> {
pub base: K,
pub layered: [Option<K>; 8],
}
Expand description
A key whose behavior depends on which layer is active.
Fields§
§base: K
The base key, used when no layers are active.
layered: [Option<K>; 8]
The layered keys, used when the corresponding layer is active.
Implementations§
Source§impl<K: Key + Copy + PartialEq> LayeredKey<K>
impl<K: Key + Copy + PartialEq> LayeredKey<K>
Source§impl<K: Key + Copy + PartialEq> LayeredKey<K>
impl<K: Key + Copy + PartialEq> LayeredKey<K>
Sourcepub fn new_pressed_key(
&self,
context: K::Context,
keymap_index: u16,
) -> (K::PressedKey, PressedKeyEvents<K::Event>)
pub fn new_pressed_key( &self, context: K::Context, keymap_index: u16, ) -> (K::PressedKey, PressedKeyEvents<K::Event>)
Presses the key, using the highest active key, if any.
Trait Implementations§
Source§impl<K: Clone + Key + Copy + PartialEq> Clone for LayeredKey<K>
impl<K: Clone + Key + Copy + PartialEq> Clone for LayeredKey<K>
Source§fn clone(&self) -> LayeredKey<K>
fn clone(&self) -> LayeredKey<K>
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<'de, K> Deserialize<'de> for LayeredKey<K>
impl<'de, K> Deserialize<'de> for LayeredKey<K>
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
impl<K: Copy + Key + Copy + PartialEq> Copy for LayeredKey<K>
impl<K: Key + Copy + PartialEq> StructuralPartialEq for LayeredKey<K>
Auto Trait Implementations§
impl<K> Freeze for LayeredKey<K>where
K: Freeze,
impl<K> RefUnwindSafe for LayeredKey<K>where
K: RefUnwindSafe,
impl<K> Send for LayeredKey<K>where
K: Send,
impl<K> Sync for LayeredKey<K>where
K: Sync,
impl<K> Unpin for LayeredKey<K>where
K: Unpin,
impl<K> UnwindSafe for LayeredKey<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