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>
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>
Sourcepub fn new(keymap: Keymap<I, R, Ctx, Ev, PKS, KS, S>) -> Self
pub fn new(keymap: Keymap<I, R, Ctx, Ev, PKS, KS, S>) -> Self
Constructs an observed keymap with a new keymap::DistinctReports.
Sourcepub fn handle_input(&mut self, ev: Event)
pub fn handle_input(&mut self, ev: Event)
Proxies keymap::Keymap::handle_input, tick
’ing the keymap appropriately.
Sourcepub fn tick(&mut self)
pub fn tick(&mut self)
Proxies keymap::Keymap::tick, updating reports appropriately.
Sourcepub fn boot_keyboard_report(&self) -> [u8; 8]
pub fn boot_keyboard_report(&self) -> [u8; 8]
Proxies keymap::Keymap::boot_keyboard_report.
Sourcepub fn distinct_reports(&self) -> &DistinctReports
pub fn distinct_reports(&self) -> &DistinctReports
Reference to distinct reports.
Sourcepub fn tick_until_no_scheduled_events(&mut self)
pub fn tick_until_no_scheduled_events(&mut self)
Ticks the keymap until there are no scheduled events, updating reports appropriately.
Trait Implementations§
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>
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>
impl<I, R, Ctx, Ev, PKS, KS, S> UnwindSafe for ObservedKeymap<I, R, Ctx, Ev, PKS, KS, S>where
I: UnwindSafe,
S: UnwindSafe,
Ctx: UnwindSafe,
R: UnwindSafe,
PKS: UnwindSafe,
KS: UnwindSafe,
Ev: 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