smart_keymap::key::composite

Type Alias ChordedPressedKey

Source
pub type ChordedPressedKey<K> = PressedKey<ChordedKey<K>, ChordedPressedKeyState<K>>;
Expand description

Convenience type alias for a key::PressedKey with a layered key.

Aliased Type§

struct ChordedPressedKey<K> {
    pub keymap_index: u16,
    pub key: ChordedKey<K>,
    pub pressed_key_state: ChordedPressedKeyState<K>,
}

Fields§

§keymap_index: u16

The index of the pressed key in some keymap.

§key: ChordedKey<K>

The pressed key.

§pressed_key_state: ChordedPressedKeyState<K>

The pressed key state.

Implementations

Source§

impl<K, S> PressedKey<K, S>

Source

pub fn map_pressed_key<IK, IS>( self, f_k: fn(_: K) -> IK, f_s: fn(_: S) -> IS, ) -> PressedKey<IK, IS>

Maps the key and pressed key state of the PressedKey to a new type.

Source

pub fn into_pressed_key<IK, IS>(self) -> PressedKey<IK, IS>
where K: Into<IK>, S: Into<IS>,

Transforms the PressedKey to a new type.

Trait Implementations

Source§

impl<K: Clone, S: Clone> Clone for PressedKey<K, S>

Source§

fn clone(&self) -> PressedKey<K, S>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K: Debug, S: Debug> Debug for PressedKey<K, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K: PartialEq, S: PartialEq> PartialEq for PressedKey<K, S>

Source§

fn eq(&self, other: &PressedKey<K, S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<K: Key, S: PressedKeyState<K, Context = K::Context, Event = K::Event>> PressedKey for PressedKey<K, S>

Source§

type Context = <K as Key>::Context

The type of Context the pressed key handles.
Source§

type Event = <K as Key>::Event

The type of Event the pressed key handles.
Source§

fn handle_event( &mut self, context: Self::Context, event: Event<Self::Event>, ) -> PressedKeyEvents<Self::Event>

Used to update the PressedKey’s state, and possibly yield event(s).
Source§

fn key_output(&self) -> KeyOutputState

Output for the pressed key.
Source§

impl<K: Copy, S: Copy> Copy for PressedKey<K, S>

Source§

impl<K, S> StructuralPartialEq for PressedKey<K, S>