pub struct UsbKeyboard<L>where
L: KeyboardLayout,{ /* private fields */ }Expand description
Encapsulates HID frame handling, and handles state transitions and key events for USB HID Keyboards
Implementations§
Source§impl<L> UsbKeyboard<L>where
L: KeyboardLayout,
impl<L> UsbKeyboard<L>where
L: KeyboardLayout,
Sourcepub fn new(layout: L, handle_ctrl: HandleControl) -> UsbKeyboard<L>
pub fn new(layout: L, handle_ctrl: HandleControl) -> UsbKeyboard<L>
Construct USB HID keyboard handler
Sourcepub fn reset_state(&mut self)
pub fn reset_state(&mut self)
Reset the USB HID state
We only get changes in key state from the keyboard, so this function resets our internal state.
Sourcepub fn handle_report_raw<'kb>(
&'kb mut self,
report: &UsbBootKeyboardReport,
) -> UsbKeyEventIter<'kb, L> ⓘ
pub fn handle_report_raw<'kb>( &'kb mut self, report: &UsbBootKeyboardReport, ) -> UsbKeyEventIter<'kb, L> ⓘ
Process a new USB HID Frame into KeyEvents
You are given an iterator, which will process the incoming report. Do not drop the iterator until it starts returning None.
Sourcepub fn handle_report<'kb>(
&'kb mut self,
report: &UsbBootKeyboardReport,
) -> UsbDecodedKeyIter<'kb, L> ⓘ
pub fn handle_report<'kb>( &'kb mut self, report: &UsbBootKeyboardReport, ) -> UsbDecodedKeyIter<'kb, L> ⓘ
Process a new USB HID Frame into Decoded keys
You are given an iterator, which will process the incoming report. Do not drop the iterator until it starts returning None.
Trait Implementations§
Auto Trait Implementations§
impl<L> Freeze for UsbKeyboard<L>where
L: Freeze,
impl<L> RefUnwindSafe for UsbKeyboard<L>where
L: RefUnwindSafe,
impl<L> Send for UsbKeyboard<L>where
L: Send,
impl<L> Sync for UsbKeyboard<L>where
L: Sync,
impl<L> Unpin for UsbKeyboard<L>where
L: Unpin,
impl<L> UnsafeUnpin for UsbKeyboard<L>where
L: UnsafeUnpin,
impl<L> UnwindSafe for UsbKeyboard<L>where
L: 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