#[repr(transparent)]pub struct KeyCode(pub(crate) RawKeyCode);
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.
Tuple Fields§
§0: RawKeyCode
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 PartialOrd for KeyCode
impl PartialOrd for KeyCode
impl Copy for KeyCode
impl Eq for KeyCode
impl StructuralPartialEq for KeyCode
Auto Trait Implementations§
impl Freeze for KeyCode
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)