pub enum PressedKeyState<K: Key> {
Pending {
pressed_indices: Vec<u16, { MAX_CHORD_SIZE }>,
satisfaction: ChordSatisfaction,
},
Resolved(ChordResolution<K::PressedKey>),
}
Expand description
State for pressed keys.
Variants§
Pending
Waiting for more Events
Fields
§
satisfaction: ChordSatisfaction
Whether the chord has been satisfied.
Resolved(ChordResolution<K::PressedKey>)
Chord resolved from Events
Implementations§
Source§impl<K: Key> PressedKeyState<K>
impl<K: Key> PressedKeyState<K>
Sourcepub fn new(context: K::Context, keymap_index: u16) -> Self
pub fn new(context: K::Context, keymap_index: u16) -> Self
Constructs a new PressedKeyState.
Sourcepub fn handle_event_for<C: ChordedKey<K>>(
&mut self,
context: K::Context,
keymap_index: u16,
key: &C,
event: Event<K::Event>,
) -> PressedKeyEvents<K::Event>
pub fn handle_event_for<C: ChordedKey<K>>( &mut self, context: K::Context, keymap_index: u16, key: &C, event: Event<K::Event>, ) -> PressedKeyEvents<K::Event>
Handle PKS for primary chorded key.
Sourcepub fn key_output(&self) -> KeyOutputState
pub fn key_output(&self) -> KeyOutputState
Key output from the pressed key state.
Trait Implementations§
Source§impl<K: Debug + Key> Debug for PressedKeyState<K>where
K::PressedKey: Debug,
impl<K: Debug + Key> Debug for PressedKeyState<K>where
K::PressedKey: Debug,
Source§impl<K: PartialEq + Key> PartialEq for PressedKeyState<K>where
K::PressedKey: PartialEq,
impl<K: PartialEq + Key> PartialEq for PressedKeyState<K>where
K::PressedKey: PartialEq,
impl<K: Key> StructuralPartialEq for PressedKeyState<K>
Auto Trait Implementations§
impl<K> Freeze for PressedKeyState<K>
impl<K> RefUnwindSafe for PressedKeyState<K>
impl<K> Send for PressedKeyState<K>
impl<K> Sync for PressedKeyState<K>
impl<K> Unpin for PressedKeyState<K>
impl<K> UnwindSafe for PressedKeyState<K>
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