smart_keymap::keymap

Struct HIDKeyboardReporter

Source
pub struct HIDKeyboardReporter { /* private fields */ }
Expand description

Transforms output from the keymap so it’s suitable for HID keyboard reports.

e.g. limits output to one new pressed key per sent report, so that the USB host doesn’t confuse the sequence of pressed keys.

Implementations§

Source§

impl HIDKeyboardReporter

Source

pub const fn new() -> Self

Constructs a new HIDKeyboardReporter.

Source

pub fn init(&mut self)

Transforms the keymap output to a HID keyboard report.

Source

pub fn update( &mut self, pressed_key_outputs: Vec<KeyOutput, { MAX_PRESSED_KEYS }>, )

Updates the state of the HIDKeyboardReporter with the given pressed key outputs.

Source

pub fn report_sent(&mut self)

Indicate an HID report was sent. Allows reporting one more key in the next report.

Source

pub fn reportable_key_outputs(&self) -> Vec<KeyOutput, { MAX_PRESSED_KEYS }>

Gets the filtered pressed key outputs, suitable for sending for HID reports.

Trait Implementations§

Source§

impl Debug for HIDKeyboardReporter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.