pub struct KeyboardBackend<I: Index<usize, Output = R> = [Ref; 1], R = Ref, Ctx = Context, Ev: Debug = Event, PKS = PendingKeyState, KS = KeyState, S = System> { /* private fields */ }Expand description
The keyboard “backend”, manages the keyboard from the events received (presses/releases of coordinates on a keyboard layout). through to listing HID scancodes to report using HIDs.
Type parameters match Keymap.
Implementations§
Source§impl<I, R, Ctx, Ev, PKS, KS, S> KeyboardBackend<I, R, Ctx, Ev, PKS, KS, S>
impl<I, R, Ctx, Ev, PKS, KS, S> KeyboardBackend<I, R, Ctx, Ev, PKS, KS, S>
Sourcepub fn new_with_keymap(keymap: Keymap<I, R, Ctx, Ev, PKS, KS, S>) -> Self
pub fn new_with_keymap(keymap: Keymap<I, R, Ctx, Ev, PKS, KS, S>) -> Self
Constructs a new keyboard backend with the given keymap.
Source§impl<I, R, Ctx, Ev, PKS, KS, S> KeyboardBackend<I, R, Ctx, Ev, PKS, KS, S>
impl<I, R, Ctx, Ev, PKS, KS, S> KeyboardBackend<I, R, Ctx, Ev, PKS, KS, S>
Sourcepub fn set_callbacks(&mut self, callbacks: KeymapCallbacks)
pub fn set_callbacks(&mut self, callbacks: KeymapCallbacks)
Set the keymap callbacks.
Sourcepub fn tick(&mut self) -> bool
pub fn tick(&mut self) -> bool
A time event.
This method must be called regularly, typically every millisecond.
Returns true if the pressed_key_codes have changed.
Sourcepub fn keymap_output(&self) -> &KeymapOutput
pub fn keymap_output(&self) -> &KeymapOutput
Returns the current keymap output.
Trait Implementations§
Auto Trait Implementations§
impl<I = [Ref; 1], R = Ref, Ctx = Context, Ev = Event, PKS = PendingKeyState, KS = KeyState, S = System> !Freeze for KeyboardBackend<I, R, Ctx, Ev, PKS, KS, S>
impl<I = [Ref; 1], R = Ref, Ctx = Context, Ev = Event, PKS = PendingKeyState, KS = KeyState, S = System> !RefUnwindSafe for KeyboardBackend<I, R, Ctx, Ev, PKS, KS, S>
impl<I, R, Ctx, Ev, PKS, KS, S> Send for KeyboardBackend<I, R, Ctx, Ev, PKS, KS, S>
impl<I = [Ref; 1], R = Ref, Ctx = Context, Ev = Event, PKS = PendingKeyState, KS = KeyState, S = System> !Sync for KeyboardBackend<I, R, Ctx, Ev, PKS, KS, S>
impl<I, R, Ctx, Ev, PKS, KS, S> Unpin for KeyboardBackend<I, R, Ctx, Ev, PKS, KS, S>
impl<I, R, Ctx, Ev, PKS, KS, S> UnsafeUnpin for KeyboardBackend<I, R, Ctx, Ev, PKS, KS, S>where
I: UnsafeUnpin,
S: UnsafeUnpin,
Ctx: UnsafeUnpin,
R: UnsafeUnpin,
PKS: UnsafeUnpin,
KS: UnsafeUnpin,
Ev: UnsafeUnpin,
impl<I, R, Ctx, Ev, PKS, KS, S> UnwindSafe for KeyboardBackend<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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more