Skip to main content

Scancode

Struct Scancode 

Source
#[repr(transparent)]
pub struct Scancode(pub u32);
Expand description

A physical key position, wrapping the raw SDL scancode value.

Tuple Fields§

§0: u32

Implementations§

Source§

impl Scancode

Source

pub const fn new(raw: u32) -> Self

Source

pub const fn raw(self) -> u32

Source§

impl Scancode

SDL scancode constants — stable across SDL2 and SDL3.

Source

pub const UNKNOWN: Scancode

Source

pub const A: Scancode

Source

pub const B: Scancode

Source

pub const C: Scancode

Source

pub const D: Scancode

Source

pub const E: Scancode

Source

pub const F: Scancode

Source

pub const G: Scancode

Source

pub const H: Scancode

Source

pub const I: Scancode

Source

pub const J: Scancode

Source

pub const K: Scancode

Source

pub const L: Scancode

Source

pub const M: Scancode

Source

pub const N: Scancode

Source

pub const O: Scancode

Source

pub const P: Scancode

Source

pub const Q: Scancode

Source

pub const R: Scancode

Source

pub const S: Scancode

Source

pub const T: Scancode

Source

pub const U: Scancode

Source

pub const V: Scancode

Source

pub const W: Scancode

Source

pub const X: Scancode

Source

pub const Y: Scancode

Source

pub const Z: Scancode

Source

pub const NUM_1: Scancode

Source

pub const NUM_2: Scancode

Source

pub const NUM_3: Scancode

Source

pub const NUM_4: Scancode

Source

pub const NUM_5: Scancode

Source

pub const NUM_6: Scancode

Source

pub const NUM_7: Scancode

Source

pub const NUM_8: Scancode

Source

pub const NUM_9: Scancode

Source

pub const NUM_0: Scancode

Source

pub const RETURN: Scancode

Source

pub const ESCAPE: Scancode

Source

pub const BACKSPACE: Scancode

Source

pub const TAB: Scancode

Source

pub const SPACE: Scancode

Source

pub const MINUS: Scancode

Source

pub const EQUALS: Scancode

Source

pub const LEFT_BRACKET: Scancode

Source

pub const RIGHT_BRACKET: Scancode

Source

pub const BACKSLASH: Scancode

Source

pub const NON_US_HASH: Scancode

Source

pub const SEMICOLON: Scancode

Source

pub const APOSTROPHE: Scancode

Source

pub const GRAVE: Scancode

Source

pub const COMMA: Scancode

Source

pub const PERIOD: Scancode

Source

pub const SLASH: Scancode

Source

pub const CAPSLOCK: Scancode

Source

pub const F1: Scancode

Source

pub const F2: Scancode

Source

pub const F3: Scancode

Source

pub const F4: Scancode

Source

pub const F5: Scancode

Source

pub const F6: Scancode

Source

pub const F7: Scancode

Source

pub const F8: Scancode

Source

pub const F9: Scancode

Source

pub const F10: Scancode

Source

pub const F11: Scancode

Source

pub const F12: Scancode

Source

pub const PRINT_SCREEN: Scancode

Source

pub const SCROLL_LOCK: Scancode

Source

pub const PAUSE: Scancode

Source

pub const INSERT: Scancode

Source

pub const HOME: Scancode

Source

pub const PAGE_UP: Scancode

Source

pub const DELETE: Scancode

Source

pub const END: Scancode

Source

pub const PAGE_DOWN: Scancode

Source

pub const RIGHT: Scancode

Source

pub const LEFT: Scancode

Source

pub const DOWN: Scancode

Source

pub const UP: Scancode

Source

pub const NUM_LOCK_CLEAR: Scancode

Source

pub const KP_DIVIDE: Scancode

Source

pub const KP_MULTIPLY: Scancode

Source

pub const KP_MINUS: Scancode

Source

pub const KP_PLUS: Scancode

Source

pub const KP_ENTER: Scancode

Source

pub const KP_1: Scancode

Source

pub const KP_2: Scancode

Source

pub const KP_3: Scancode

Source

pub const KP_4: Scancode

Source

pub const KP_5: Scancode

Source

pub const KP_6: Scancode

Source

pub const KP_7: Scancode

Source

pub const KP_8: Scancode

Source

pub const KP_9: Scancode

Source

pub const KP_0: Scancode

Source

pub const KP_PERIOD: Scancode

Source

pub const NON_US_BACKSLASH: Scancode

Source

pub const APPLICATION: Scancode

Source

pub const POWER: Scancode

Source

pub const KP_EQUALS: Scancode

Source

pub const F13: Scancode

Source

pub const F14: Scancode

Source

pub const F15: Scancode

Source

pub const F16: Scancode

Source

pub const F17: Scancode

Source

pub const F18: Scancode

Source

pub const F19: Scancode

Source

pub const F20: Scancode

Source

pub const F21: Scancode

Source

pub const F22: Scancode

Source

pub const F23: Scancode

Source

pub const F24: Scancode

Source

pub const MENU: Scancode

Source

pub const INTERNATIONAL1: Scancode

Source

pub const INTERNATIONAL2: Scancode

Source

pub const INTERNATIONAL3: Scancode

Source

pub const INTERNATIONAL4: Scancode

Source

pub const INTERNATIONAL5: Scancode

Source

pub const INTERNATIONAL6: Scancode

Source

pub const INTERNATIONAL7: Scancode

Source

pub const INTERNATIONAL8: Scancode

Source

pub const INTERNATIONAL9: Scancode

Source

pub const LANG1: Scancode

Source

pub const LANG2: Scancode

Source

pub const LANG3: Scancode

Source

pub const LANG4: Scancode

Source

pub const LANG5: Scancode

Source

pub const LCTRL: Scancode

Source

pub const LSHIFT: Scancode

Source

pub const LALT: Scancode

Source

pub const LGUI: Scancode

Source

pub const RCTRL: Scancode

Source

pub const RSHIFT: Scancode

Source

pub const RALT: Scancode

Source

pub const RGUI: Scancode

Trait Implementations§

Source§

impl Clone for Scancode

Source§

fn clone(&self) -> Scancode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Scancode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Scancode> for u32

Source§

fn from(value: Scancode) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Scancode

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl Hash for Scancode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Scancode

Source§

fn cmp(&self, other: &Scancode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for Scancode

Source§

fn eq(&self, other: &Scancode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Scancode

Source§

fn partial_cmp(&self, other: &Scancode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for Scancode

Source§

impl Eq for Scancode

Source§

impl StructuralPartialEq for Scancode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.