pub struct KeyCode(/* private fields */);
Expand description
The keyboard code, often corresponding to a physical key.
Keyboard events usually return this type directly, and leave it to be the responsibility of the user to convert it to a keyboard symbol.
Implementations§
source§impl KeyCode
impl KeyCode
sourcepub const fn new(raw: RawKeyCode) -> Self
pub const fn new(raw: RawKeyCode) -> Self
Create a new KeyCode
from a raw keyboard code.
sourcepub const fn raw(self) -> RawKeyCode
pub const fn raw(self) -> RawKeyCode
Get the raw keyboard code.
Trait Implementations§
source§impl From<KeyCode> for RawKeyCode
impl From<KeyCode> for RawKeyCode
source§impl From<u32> for KeyCode
impl From<u32> for KeyCode
source§fn from(raw: RawKeyCode) -> Self
fn from(raw: RawKeyCode) -> Self
Converts to this type from the input type.
source§impl Ord for KeyCode
impl Ord for KeyCode
source§impl PartialEq for KeyCode
impl PartialEq for KeyCode
source§impl PartialOrd for KeyCode
impl PartialOrd for KeyCode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for KeyCode
impl Eq for KeyCode
impl StructuralEq for KeyCode
impl StructuralPartialEq for KeyCode
Auto Trait Implementations§
impl RefUnwindSafe for KeyCode
impl Send for KeyCode
impl Sync for KeyCode
impl Unpin for KeyCode
impl UnwindSafe for KeyCode
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