pub struct Key {
pub(crate) bytes: [u8; 4],
pub(crate) len: u8,
pub(crate) scan: u8,
pub(crate) ascii: u8,
}Expand description
One queued key, in the encodings the two PC consumers expect.
Fields§
§bytes: [u8; 4]Scancode bytes the 8042 must receive (2 or 4 bytes).
len: u8Number of valid bytes in Self::bytes.
scan: u8Scan code the firmware keyboard buffer stores.
ascii: u8ASCII byte the firmware keyboard buffer stores (0 for extended keys).
Implementations§
Source§impl Key
impl Key
Sourcefn build(byte: u8) -> Option<Self>
fn build(byte: u8) -> Option<Self>
Translates one host byte into its two encodings.
None means the byte cannot be typed on a PC keyboard (a control byte
other than the named ones), so it is skipped instead of typed as garbage.
Sourcepub const fn scancode_len(&self) -> usize
pub const fn scancode_len(&self) -> usize
Number of scancode bytes this key occupies on the 8042 path.
Trait Implementations§
impl Copy for Key
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Forget for Key
impl Freeze for Key
impl Move for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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