smart_keymap::key

Trait PressedKey

Source
pub trait PressedKey: Debug {
    type Context;
    type Event;

    // Required methods
    fn handle_event(
        &mut self,
        context: Self::Context,
        event: Event<Self::Event>,
    ) -> PressedKeyEvents<Self::Event>;
    fn key_output(&self) -> KeyOutputState;
}
Expand description

PressedKeyState for a stateful pressed key value.

Required Associated Types§

Source

type Context

The type of Context the pressed key handles.

Source

type Event

The type of Event the pressed key handles.

Required Methods§

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.

Implementors§

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

Source§

type Event = <K as Key>::Event