pub trait PressedKeyState<K>: Debug {
type Context;
type Event;
// Required methods
fn handle_event_for(
&mut self,
context: Self::Context,
keymap_index: u16,
key: &K,
event: Event<Self::Event>,
) -> PressedKeyEvents<Self::Event>;
fn key_output(&self, key: &K) -> KeyOutputState;
}
Expand description
Implements functionality for the pressed key.
e.g. tap_hold::PressedKeyState implements behaviour resolving the pressed tap hold key as either ‘tap’ or ‘hold’.
Required Associated Types§
Required Methods§
Sourcefn handle_event_for(
&mut self,
context: Self::Context,
keymap_index: u16,
key: &K,
event: Event<Self::Event>,
) -> PressedKeyEvents<Self::Event>
fn handle_event_for( &mut self, context: Self::Context, keymap_index: u16, key: &K, event: Event<Self::Event>, ) -> PressedKeyEvents<Self::Event>
Used to update the PressedKeyState’s state, and possibly yield event(s).
Sourcefn key_output(&self, key: &K) -> KeyOutputState
fn key_output(&self, key: &K) -> KeyOutputState
Output for the pressed key state.