pub trait KeyState: Debug {
type Context;
type Event: Copy + Debug;
// Provided methods
fn handle_event(
&mut self,
_context: &Self::Context,
_keymap_index: u16,
_event: Event<Self::Event>,
) -> KeyEvents<Self::Event> { ... }
fn key_output(&self) -> Option<KeyOutput> { ... }
}
Expand description
Implements functionality for the pressed key.
Required Associated Types§
Provided Methods§
Sourcefn handle_event(
&mut self,
_context: &Self::Context,
_keymap_index: u16,
_event: Event<Self::Event>,
) -> KeyEvents<Self::Event>
fn handle_event( &mut self, _context: &Self::Context, _keymap_index: u16, _event: Event<Self::Event>, ) -> KeyEvents<Self::Event>
Used to update the KeyState’s state, and possibly yield event(s).
Sourcefn key_output(&self) -> Option<KeyOutput>
fn key_output(&self) -> Option<KeyOutput>
Output for the pressed key state.