pub struct Keymap<I> { /* private fields */ }
Expand description
State for a keymap that handles input, and outputs HID keyboard reports.
Implementations§
Source§impl<K: Key<Context = Context, Event = Event, PressedKey = PressedKey> + ?Sized, I: IndexMut<usize, Output = K>> Keymap<I>
impl<K: Key<Context = Context, Event = Event, PressedKey = PressedKey> + ?Sized, I: IndexMut<usize, Output = K>> Keymap<I>
Sourcepub const fn new(key_definitions: I, context: Context) -> Self
pub const fn new(key_definitions: I, context: Context) -> Self
Constructs a new keymap with the given key definitions and context.
Sourcepub fn handle_input(&mut self, ev: Event)
pub fn handle_input(&mut self, ev: Event)
Handles input events.
Sourcepub fn pressed_keys(&self) -> Vec<KeyOutput, { MAX_PRESSED_KEYS }>
pub fn pressed_keys(&self) -> Vec<KeyOutput, { MAX_PRESSED_KEYS }>
Returns the the pressed key outputs.
Sourcepub fn report_output(&mut self) -> KeymapOutput
pub fn report_output(&mut self) -> KeymapOutput
Updates the keymap indicating a report is sent; returns the reportable keymap output.
Trait Implementations§
Auto Trait Implementations§
impl<I> !Freeze for Keymap<I>
impl<I> !RefUnwindSafe for Keymap<I>
impl<I> Send for Keymap<I>where
I: Send,
impl<I> !Sync for Keymap<I>
impl<I> Unpin for Keymap<I>where
I: Unpin,
impl<I> UnwindSafe for Keymap<I>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more