#[repr(transparent)]pub struct SDL_Scancode(pub c_int);Expand description
The SDL keyboard scancode representation.
An SDL scancode is the physical representation of a key on the keyboard, independent of language and keyboard mapping.
Values of this type are used to represent keyboard keys, among other places
in the scancode field of the SDL_KeyboardEvent structure.
The values in this enumeration are based on the USB usage page standard: https://usb.org/sites/default/files/hut1_5.pdf
§Availability
This enum is available since SDL 3.2.0.
§Known values (sdl3-sys)
Tuple Fields§
§0: c_intImplementations§
Source§impl SDL_Scancode
impl SDL_Scancode
pub const UNKNOWN: Self
pub const A: Self
pub const B: Self
pub const C: Self
pub const D: Self
pub const E: Self
pub const F: Self
pub const G: Self
pub const H: Self
pub const I: Self
pub const J: Self
pub const K: Self
pub const L: Self
pub const M: Self
pub const N: Self
pub const O: Self
pub const P: Self
pub const Q: Self
pub const R: Self
pub const S: Self
pub const T: Self
pub const U: Self
pub const V: Self
pub const W: Self
pub const X: Self
pub const Y: Self
pub const Z: Self
pub const _1: Self
pub const _2: Self
pub const _3: Self
pub const _4: Self
pub const _5: Self
pub const _6: Self
pub const _7: Self
pub const _8: Self
pub const _9: Self
pub const _0: Self
pub const RETURN: Self
pub const ESCAPE: Self
pub const BACKSPACE: Self
pub const TAB: Self
pub const SPACE: Self
pub const MINUS: Self
pub const EQUALS: Self
pub const LEFTBRACKET: Self
pub const RIGHTBRACKET: Self
Sourcepub const BACKSLASH: Self
pub const BACKSLASH: Self
Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout.
Sourcepub const NONUSHASH: Self
pub const NONUSHASH: Self
ISO USB keyboards actually use this code
instead of 49 for the same key, but all
OSes I’ve seen treat the two codes
identically. So, as an implementor, unless
your keyboard generates both of those
codes and your OS treats them differently,
you should generate SDL_SCANCODE_BACKSLASH
instead of this code. As a user, you
should not rely on this code because SDL
will never generate it with most (all?)
keyboards.
pub const SEMICOLON: Self
pub const APOSTROPHE: Self
Sourcepub const GRAVE: Self
pub const GRAVE: Self
Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards.
pub const COMMA: Self
pub const PERIOD: Self
pub const SLASH: Self
pub const CAPSLOCK: Self
pub const F1: Self
pub const F2: Self
pub const F3: Self
pub const F4: Self
pub const F5: Self
pub const F6: Self
pub const F7: Self
pub const F8: Self
pub const F9: Self
pub const F10: Self
pub const F11: Self
pub const F12: Self
pub const PRINTSCREEN: Self
pub const SCROLLLOCK: Self
pub const PAUSE: Self
Sourcepub const INSERT: Self
pub const INSERT: Self
insert on PC, help on some Mac keyboards (but does send code 73, not 117)
pub const HOME: Self
pub const PAGEUP: Self
pub const DELETE: Self
pub const END: Self
pub const PAGEDOWN: Self
pub const RIGHT: Self
pub const LEFT: Self
pub const DOWN: Self
pub const UP: Self
Sourcepub const NUMLOCKCLEAR: Self
pub const NUMLOCKCLEAR: Self
num lock on PC, clear on Mac keyboards
pub const KP_DIVIDE: Self
pub const KP_MULTIPLY: Self
pub const KP_MINUS: Self
pub const KP_PLUS: Self
pub const KP_ENTER: Self
pub const KP_1: Self
pub const KP_2: Self
pub const KP_3: Self
pub const KP_4: Self
pub const KP_5: Self
pub const KP_6: Self
pub const KP_7: Self
pub const KP_8: Self
pub const KP_9: Self
pub const KP_0: Self
pub const KP_PERIOD: Self
Sourcepub const NONUSBACKSLASH: Self
pub const NONUSBACKSLASH: Self
This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Z. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout.
Sourcepub const APPLICATION: Self
pub const APPLICATION: Self
windows contextual menu, compose
Sourcepub const POWER: Self
pub const POWER: Self
The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key.
pub const KP_EQUALS: Self
pub const F13: Self
pub const F14: Self
pub const F15: Self
pub const F16: Self
pub const F17: Self
pub const F18: Self
pub const F19: Self
pub const F20: Self
pub const F21: Self
pub const F22: Self
pub const F23: Self
pub const F24: Self
pub const EXECUTE: Self
pub const SELECT: Self
pub const MUTE: Self
pub const VOLUMEUP: Self
pub const VOLUMEDOWN: Self
pub const KP_COMMA: Self
pub const KP_EQUALSAS400: Self
Sourcepub const INTERNATIONAL1: Self
pub const INTERNATIONAL1: Self
used on Asian keyboards, see footnotes in USB doc
pub const INTERNATIONAL2: Self
Sourcepub const INTERNATIONAL3: Self
pub const INTERNATIONAL3: Self
Yen
pub const INTERNATIONAL4: Self
pub const INTERNATIONAL5: Self
pub const INTERNATIONAL6: Self
pub const INTERNATIONAL7: Self
pub const INTERNATIONAL8: Self
pub const INTERNATIONAL9: Self
pub const SYSREQ: Self
pub const CLEAR: Self
pub const PRIOR: Self
pub const RETURN2: Self
pub const SEPARATOR: Self
pub const OUT: Self
pub const OPER: Self
pub const CLEARAGAIN: Self
pub const CRSEL: Self
pub const EXSEL: Self
pub const KP_00: Self
pub const KP_000: Self
pub const THOUSANDSSEPARATOR: Self
pub const DECIMALSEPARATOR: Self
pub const CURRENCYUNIT: Self
pub const CURRENCYSUBUNIT: Self
pub const KP_LEFTPAREN: Self
pub const KP_RIGHTPAREN: Self
pub const KP_LEFTBRACE: Self
pub const KP_RIGHTBRACE: Self
pub const KP_TAB: Self
pub const KP_BACKSPACE: Self
pub const KP_A: Self
pub const KP_B: Self
pub const KP_C: Self
pub const KP_D: Self
pub const KP_E: Self
pub const KP_F: Self
pub const KP_XOR: Self
pub const KP_POWER: Self
pub const KP_PERCENT: Self
pub const KP_LESS: Self
pub const KP_GREATER: Self
pub const KP_AMPERSAND: Self
pub const KP_DBLAMPERSAND: Self
pub const KP_VERTICALBAR: Self
pub const KP_DBLVERTICALBAR: Self
pub const KP_COLON: Self
pub const KP_HASH: Self
pub const KP_SPACE: Self
pub const KP_AT: Self
pub const KP_EXCLAM: Self
pub const KP_MEMSTORE: Self
pub const KP_MEMRECALL: Self
pub const KP_MEMCLEAR: Self
pub const KP_MEMADD: Self
pub const KP_MEMSUBTRACT: Self
pub const KP_MEMMULTIPLY: Self
pub const KP_MEMDIVIDE: Self
pub const KP_PLUSMINUS: Self
pub const KP_CLEAR: Self
pub const KP_CLEARENTRY: Self
pub const KP_BINARY: Self
pub const KP_OCTAL: Self
pub const KP_DECIMAL: Self
pub const KP_HEXADECIMAL: Self
pub const LCTRL: Self
pub const LSHIFT: Self
pub const RCTRL: Self
pub const RSHIFT: Self
Sourcepub const MODE: Self
pub const MODE: Self
I’m not sure if this is really not covered
by any of the above, but since there’s a
special SDL_KMOD_MODE for it I’m adding it here
Sourcepub const CHANNEL_INCREMENT: Self
pub const CHANNEL_INCREMENT: Self
Channel Increment
Sourcepub const CHANNEL_DECREMENT: Self
pub const CHANNEL_DECREMENT: Self
Channel Decrement
Sourcepub const MEDIA_PLAY: Self
pub const MEDIA_PLAY: Self
Play
Sourcepub const MEDIA_PAUSE: Self
pub const MEDIA_PAUSE: Self
Pause
Sourcepub const MEDIA_RECORD: Self
pub const MEDIA_RECORD: Self
Record
Sourcepub const MEDIA_FAST_FORWARD: Self
pub const MEDIA_FAST_FORWARD: Self
Fast Forward
Sourcepub const MEDIA_REWIND: Self
pub const MEDIA_REWIND: Self
Rewind
Sourcepub const MEDIA_NEXT_TRACK: Self
pub const MEDIA_NEXT_TRACK: Self
Next Track
Sourcepub const MEDIA_PREVIOUS_TRACK: Self
pub const MEDIA_PREVIOUS_TRACK: Self
Previous Track
Sourcepub const MEDIA_STOP: Self
pub const MEDIA_STOP: Self
Stop
Sourcepub const MEDIA_EJECT: Self
pub const MEDIA_EJECT: Self
Eject
Sourcepub const MEDIA_PLAY_PAUSE: Self
pub const MEDIA_PLAY_PAUSE: Self
Play / Pause
pub const MEDIA_SELECT: Self
Sourcepub const AC_PROPERTIES: Self
pub const AC_PROPERTIES: Self
AC Properties
Sourcepub const AC_FORWARD: Self
pub const AC_FORWARD: Self
AC Forward
Sourcepub const AC_REFRESH: Self
pub const AC_REFRESH: Self
AC Refresh
Sourcepub const AC_BOOKMARKS: Self
pub const AC_BOOKMARKS: Self
AC Bookmarks
Sourcepub const SOFTLEFT: Self
pub const SOFTLEFT: Self
Usually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom left of the display.
Trait Implementations§
Source§impl Clone for SDL_Scancode
impl Clone for SDL_Scancode
Source§fn clone(&self) -> SDL_Scancode
fn clone(&self) -> SDL_Scancode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SDL_Scancode
Available on crate feature debug-impls only.
impl Debug for SDL_Scancode
debug-impls only.Source§impl Default for SDL_Scancode
impl Default for SDL_Scancode
Source§fn default() -> SDL_Scancode
fn default() -> SDL_Scancode
Source§impl From<SDL_Scancode> for c_int
impl From<SDL_Scancode> for c_int
Source§fn from(value: SDL_Scancode) -> Self
fn from(value: SDL_Scancode) -> Self
Source§impl GroupMetadata for SDL_Scancode
Available on crate feature metadata only.
impl GroupMetadata for SDL_Scancode
metadata only.