pub struct Key<R: Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> {
pub chords: Slice<(ChordId, R), MAX_OVERLAPPING_CHORD_SIZE>,
pub passthrough: R,
/* private fields */
}
Expand description
Primary Chorded key (with a passthrough key).
The primary key is the key with the lowest index in the chord, and has the key used for the resolved chord.
Fields§
§chords: Slice<(ChordId, R), MAX_OVERLAPPING_CHORD_SIZE>
The chorded key
passthrough: R
The passthrough key
Implementations§
Source§impl<R: Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<R: Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>
Sourcepub fn new_pressed_key(
&self,
context: &Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>,
keymap_index: u16,
) -> (PressedKeyResult<R, PendingKeyState<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>, KeyState>, KeyEvents<Event>)
pub fn new_pressed_key( &self, context: &Context<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>, keymap_index: u16, ) -> (PressedKeyResult<R, PendingKeyState<MAX_CHORDS, MAX_CHORD_SIZE, MAX_PRESSED_INDICES>, KeyState>, KeyEvents<Event>)
Constructs new pressed key.
Trait Implementations§
Source§impl<R: Clone + Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Clone for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<R: Clone + Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Clone for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>
Source§impl<R: Debug + Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Debug for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<R: Debug + Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Debug for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>
Source§impl<'de, R, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Deserialize<'de> for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>where
R: Deserialize<'de> + Copy,
impl<'de, R, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Deserialize<'de> for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>where
R: Deserialize<'de> + Copy,
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<R: PartialEq + Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> PartialEq for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<R: PartialEq + Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> PartialEq for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<R: Copy + Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Copy for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>
impl<R: Copy, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> StructuralPartialEq for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>
Auto Trait Implementations§
impl<R, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Freeze for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>where
R: Freeze,
impl<R, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> RefUnwindSafe for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>where
R: RefUnwindSafe,
impl<R, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Send for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>where
R: Send,
impl<R, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Sync for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>where
R: Sync,
impl<R, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> Unpin for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>where
R: Unpin,
impl<R, const MAX_CHORDS: usize, const MAX_CHORD_SIZE: usize, const MAX_OVERLAPPING_CHORD_SIZE: usize, const MAX_PRESSED_INDICES: usize> UnwindSafe for Key<R, MAX_CHORDS, MAX_CHORD_SIZE, MAX_OVERLAPPING_CHORD_SIZE, MAX_PRESSED_INDICES>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