pub struct Scancode(pub u32);Expand description
Input vocabulary, defined in crcbl_core::input and re-exported so a
consumer of the event stream needs one use rather than two.
See the crate docs for why these live in crcbl-core.
The raw, platform-assigned code for a physical key.
Opaque on purpose: its numbering is whatever the window system uses (Linux
evdev codes offset by 8 on both Wayland and X11, MapVirtualKey scan codes
on Win32, kVK_* on macOS). It exists so a key the engine has no
KeyCode name for can still be bound, logged and round-tripped through a
profile rather than being silently dropped.
Never compare a Scancode against a literal in engine code — that is
platform sniffing with extra steps. Compare KeyCode.
Tuple Fields§
§0: u32Trait Implementations§
impl Copy for Scancode
impl Eq for Scancode
Source§impl Ord for Scancode
impl Ord for Scancode
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Scancode
impl PartialOrd for Scancode
impl StructuralPartialEq for Scancode
Auto Trait Implementations§
impl Freeze for Scancode
impl RefUnwindSafe for Scancode
impl Send for Scancode
impl Sync for Scancode
impl Unpin for Scancode
impl UnsafeUnpin for Scancode
impl UnwindSafe for Scancode
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