Trait KeyState
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§
type Context
type Context
The type of Context the pressed key state handles.
Provided Methods§
fn 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).
fn key_output(&self) -> Option<KeyOutput>
fn key_output(&self) -> Option<KeyOutput>
Output for the pressed key state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".