Struct ObservedKeymap

Source
pub struct ObservedKeymap<I: Index<usize, Output = R>, R, Ctx, Ev: Debug, PKS, KS, S> { /* private fields */ }
Expand description

Wrapper around a crate::keymap::Keymap that also tracks distinct HID reports.

Implementations§

Source§

impl<I: Debug + Index<usize, Output = R>, R: Copy + Debug, Ctx: Debug + Context<Event = Ev> + SetKeymapContext, Ev: Copy + Debug, PKS: Debug, KS: Copy + Debug + From<NoOpKeyState>, S: System<R, Ref = R, Context = Ctx, Event = Ev, PendingKeyState = PKS, KeyState = KS>> ObservedKeymap<I, R, Ctx, Ev, PKS, KS, S>

Source

pub fn new(keymap: Keymap<I, R, Ctx, Ev, PKS, KS, S>) -> Self

Constructs an observed keymap with a new keymap::DistinctReports.

Source

pub fn handle_input(&mut self, ev: Event)

Proxies keymap::Keymap::handle_input, tick’ing the keymap appropriately.

Source

pub fn tick(&mut self)

Proxies keymap::Keymap::tick, updating reports appropriately.

Source

pub fn boot_keyboard_report(&self) -> [u8; 8]

Source

pub fn distinct_reports(&self) -> &DistinctReports

Reference to distinct reports.

Source

pub fn tick_until_no_scheduled_events(&mut self)

Ticks the keymap until there are no scheduled events, updating reports appropriately.

Trait Implementations§

Source§

impl<I: Debug + Index<usize, Output = R>, R: Debug, Ctx: Debug, Ev: Debug + Debug, PKS: Debug, KS: Debug, S: Debug> Debug for ObservedKeymap<I, R, Ctx, Ev, PKS, KS, S>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I, R, Ctx, Ev, PKS, KS, S> !Freeze for ObservedKeymap<I, R, Ctx, Ev, PKS, KS, S>

§

impl<I, R, Ctx, Ev, PKS, KS, S> !RefUnwindSafe for ObservedKeymap<I, R, Ctx, Ev, PKS, KS, S>

§

impl<I, R, Ctx, Ev, PKS, KS, S> Send for ObservedKeymap<I, R, Ctx, Ev, PKS, KS, S>
where I: Send, S: Send, Ctx: Send, R: Send, PKS: Send, KS: Send, Ev: Send,

§

impl<I, R, Ctx, Ev, PKS, KS, S> !Sync for ObservedKeymap<I, R, Ctx, Ev, PKS, KS, S>

§

impl<I, R, Ctx, Ev, PKS, KS, S> Unpin for ObservedKeymap<I, R, Ctx, Ev, PKS, KS, S>
where I: Unpin, S: Unpin, Ctx: Unpin, R: Unpin, PKS: Unpin, KS: Unpin, Ev: Unpin,

§

impl<I, R, Ctx, Ev, PKS, KS, S> UnwindSafe for ObservedKeymap<I, R, Ctx, Ev, PKS, KS, S>

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.