Struct SDL_Scancode

#[repr(transparent)]
pub struct SDL_Scancode(pub i32);
Available on crate feature dep_sdl3 only.
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)

Associated constantGlobal constantDescription
UNKNOWNSDL_SCANCODE_UNKNOWN
ASDL_SCANCODE_A
BSDL_SCANCODE_B
CSDL_SCANCODE_C
DSDL_SCANCODE_D
ESDL_SCANCODE_E
FSDL_SCANCODE_F
GSDL_SCANCODE_G
HSDL_SCANCODE_H
ISDL_SCANCODE_I
JSDL_SCANCODE_J
KSDL_SCANCODE_K
LSDL_SCANCODE_L
MSDL_SCANCODE_M
NSDL_SCANCODE_N
OSDL_SCANCODE_O
PSDL_SCANCODE_P
QSDL_SCANCODE_Q
RSDL_SCANCODE_R
SSDL_SCANCODE_S
TSDL_SCANCODE_T
USDL_SCANCODE_U
VSDL_SCANCODE_V
WSDL_SCANCODE_W
XSDL_SCANCODE_X
YSDL_SCANCODE_Y
ZSDL_SCANCODE_Z
_1SDL_SCANCODE_1
_2SDL_SCANCODE_2
_3SDL_SCANCODE_3
_4SDL_SCANCODE_4
_5SDL_SCANCODE_5
_6SDL_SCANCODE_6
_7SDL_SCANCODE_7
_8SDL_SCANCODE_8
_9SDL_SCANCODE_9
_0SDL_SCANCODE_0
RETURNSDL_SCANCODE_RETURN
ESCAPESDL_SCANCODE_ESCAPE
BACKSPACESDL_SCANCODE_BACKSPACE
TABSDL_SCANCODE_TAB
SPACESDL_SCANCODE_SPACE
MINUSSDL_SCANCODE_MINUS
EQUALSSDL_SCANCODE_EQUALS
LEFTBRACKETSDL_SCANCODE_LEFTBRACKET
RIGHTBRACKETSDL_SCANCODE_RIGHTBRACKET
BACKSLASHSDL_SCANCODE_BACKSLASHLocated 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.
NONUSHASHSDL_SCANCODE_NONUSHASHISO 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.
SEMICOLONSDL_SCANCODE_SEMICOLON
APOSTROPHESDL_SCANCODE_APOSTROPHE
GRAVESDL_SCANCODE_GRAVELocated 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.
COMMASDL_SCANCODE_COMMA
PERIODSDL_SCANCODE_PERIOD
SLASHSDL_SCANCODE_SLASH
CAPSLOCKSDL_SCANCODE_CAPSLOCK
F1SDL_SCANCODE_F1
F2SDL_SCANCODE_F2
F3SDL_SCANCODE_F3
F4SDL_SCANCODE_F4
F5SDL_SCANCODE_F5
F6SDL_SCANCODE_F6
F7SDL_SCANCODE_F7
F8SDL_SCANCODE_F8
F9SDL_SCANCODE_F9
F10SDL_SCANCODE_F10
F11SDL_SCANCODE_F11
F12SDL_SCANCODE_F12
PRINTSCREENSDL_SCANCODE_PRINTSCREEN
SCROLLLOCKSDL_SCANCODE_SCROLLLOCK
PAUSESDL_SCANCODE_PAUSE
INSERTSDL_SCANCODE_INSERTinsert on PC, help on some Mac keyboards (but does send code 73, not 117)
HOMESDL_SCANCODE_HOME
PAGEUPSDL_SCANCODE_PAGEUP
DELETESDL_SCANCODE_DELETE
ENDSDL_SCANCODE_END
PAGEDOWNSDL_SCANCODE_PAGEDOWN
RIGHTSDL_SCANCODE_RIGHT
LEFTSDL_SCANCODE_LEFT
DOWNSDL_SCANCODE_DOWN
UPSDL_SCANCODE_UP
NUMLOCKCLEARSDL_SCANCODE_NUMLOCKCLEARnum lock on PC, clear on Mac keyboards
KP_DIVIDESDL_SCANCODE_KP_DIVIDE
KP_MULTIPLYSDL_SCANCODE_KP_MULTIPLY
KP_MINUSSDL_SCANCODE_KP_MINUS
KP_PLUSSDL_SCANCODE_KP_PLUS
KP_ENTERSDL_SCANCODE_KP_ENTER
KP_1SDL_SCANCODE_KP_1
KP_2SDL_SCANCODE_KP_2
KP_3SDL_SCANCODE_KP_3
KP_4SDL_SCANCODE_KP_4
KP_5SDL_SCANCODE_KP_5
KP_6SDL_SCANCODE_KP_6
KP_7SDL_SCANCODE_KP_7
KP_8SDL_SCANCODE_KP_8
KP_9SDL_SCANCODE_KP_9
KP_0SDL_SCANCODE_KP_0
KP_PERIODSDL_SCANCODE_KP_PERIOD
NONUSBACKSLASHSDL_SCANCODE_NONUSBACKSLASHThis is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. 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.
APPLICATIONSDL_SCANCODE_APPLICATIONwindows contextual menu, compose
POWERSDL_SCANCODE_POWERThe USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key.
KP_EQUALSSDL_SCANCODE_KP_EQUALS
F13SDL_SCANCODE_F13
F14SDL_SCANCODE_F14
F15SDL_SCANCODE_F15
F16SDL_SCANCODE_F16
F17SDL_SCANCODE_F17
F18SDL_SCANCODE_F18
F19SDL_SCANCODE_F19
F20SDL_SCANCODE_F20
F21SDL_SCANCODE_F21
F22SDL_SCANCODE_F22
F23SDL_SCANCODE_F23
F24SDL_SCANCODE_F24
EXECUTESDL_SCANCODE_EXECUTE
HELPSDL_SCANCODE_HELPAL Integrated Help Center
MENUSDL_SCANCODE_MENUMenu (show menu)
SELECTSDL_SCANCODE_SELECT
STOPSDL_SCANCODE_STOPAC Stop
AGAINSDL_SCANCODE_AGAINAC Redo/Repeat
UNDOSDL_SCANCODE_UNDOAC Undo
CUTSDL_SCANCODE_CUTAC Cut
COPYSDL_SCANCODE_COPYAC Copy
PASTESDL_SCANCODE_PASTEAC Paste
FINDSDL_SCANCODE_FINDAC Find
MUTESDL_SCANCODE_MUTE
VOLUMEUPSDL_SCANCODE_VOLUMEUP
VOLUMEDOWNSDL_SCANCODE_VOLUMEDOWN
KP_COMMASDL_SCANCODE_KP_COMMA
KP_EQUALSAS400SDL_SCANCODE_KP_EQUALSAS400
INTERNATIONAL1SDL_SCANCODE_INTERNATIONAL1used on Asian keyboards, see footnotes in USB doc
INTERNATIONAL2SDL_SCANCODE_INTERNATIONAL2
INTERNATIONAL3SDL_SCANCODE_INTERNATIONAL3Yen
INTERNATIONAL4SDL_SCANCODE_INTERNATIONAL4
INTERNATIONAL5SDL_SCANCODE_INTERNATIONAL5
INTERNATIONAL6SDL_SCANCODE_INTERNATIONAL6
INTERNATIONAL7SDL_SCANCODE_INTERNATIONAL7
INTERNATIONAL8SDL_SCANCODE_INTERNATIONAL8
INTERNATIONAL9SDL_SCANCODE_INTERNATIONAL9
LANG1SDL_SCANCODE_LANG1Hangul/English toggle
LANG2SDL_SCANCODE_LANG2Hanja conversion
LANG3SDL_SCANCODE_LANG3Katakana
LANG4SDL_SCANCODE_LANG4Hiragana
LANG5SDL_SCANCODE_LANG5Zenkaku/Hankaku
LANG6SDL_SCANCODE_LANG6reserved
LANG7SDL_SCANCODE_LANG7reserved
LANG8SDL_SCANCODE_LANG8reserved
LANG9SDL_SCANCODE_LANG9reserved
ALTERASESDL_SCANCODE_ALTERASEErase-Eaze
SYSREQSDL_SCANCODE_SYSREQ
CANCELSDL_SCANCODE_CANCELAC Cancel
CLEARSDL_SCANCODE_CLEAR
PRIORSDL_SCANCODE_PRIOR
RETURN2SDL_SCANCODE_RETURN2
SEPARATORSDL_SCANCODE_SEPARATOR
OUTSDL_SCANCODE_OUT
OPERSDL_SCANCODE_OPER
CLEARAGAINSDL_SCANCODE_CLEARAGAIN
CRSELSDL_SCANCODE_CRSEL
EXSELSDL_SCANCODE_EXSEL
KP_00SDL_SCANCODE_KP_00
KP_000SDL_SCANCODE_KP_000
THOUSANDSSEPARATORSDL_SCANCODE_THOUSANDSSEPARATOR
DECIMALSEPARATORSDL_SCANCODE_DECIMALSEPARATOR
CURRENCYUNITSDL_SCANCODE_CURRENCYUNIT
CURRENCYSUBUNITSDL_SCANCODE_CURRENCYSUBUNIT
KP_LEFTPARENSDL_SCANCODE_KP_LEFTPAREN
KP_RIGHTPARENSDL_SCANCODE_KP_RIGHTPAREN
KP_LEFTBRACESDL_SCANCODE_KP_LEFTBRACE
KP_RIGHTBRACESDL_SCANCODE_KP_RIGHTBRACE
KP_TABSDL_SCANCODE_KP_TAB
KP_BACKSPACESDL_SCANCODE_KP_BACKSPACE
KP_ASDL_SCANCODE_KP_A
KP_BSDL_SCANCODE_KP_B
KP_CSDL_SCANCODE_KP_C
KP_DSDL_SCANCODE_KP_D
KP_ESDL_SCANCODE_KP_E
KP_FSDL_SCANCODE_KP_F
KP_XORSDL_SCANCODE_KP_XOR
KP_POWERSDL_SCANCODE_KP_POWER
KP_PERCENTSDL_SCANCODE_KP_PERCENT
KP_LESSSDL_SCANCODE_KP_LESS
KP_GREATERSDL_SCANCODE_KP_GREATER
KP_AMPERSANDSDL_SCANCODE_KP_AMPERSAND
KP_DBLAMPERSANDSDL_SCANCODE_KP_DBLAMPERSAND
KP_VERTICALBARSDL_SCANCODE_KP_VERTICALBAR
KP_DBLVERTICALBARSDL_SCANCODE_KP_DBLVERTICALBAR
KP_COLONSDL_SCANCODE_KP_COLON
KP_HASHSDL_SCANCODE_KP_HASH
KP_SPACESDL_SCANCODE_KP_SPACE
KP_ATSDL_SCANCODE_KP_AT
KP_EXCLAMSDL_SCANCODE_KP_EXCLAM
KP_MEMSTORESDL_SCANCODE_KP_MEMSTORE
KP_MEMRECALLSDL_SCANCODE_KP_MEMRECALL
KP_MEMCLEARSDL_SCANCODE_KP_MEMCLEAR
KP_MEMADDSDL_SCANCODE_KP_MEMADD
KP_MEMSUBTRACTSDL_SCANCODE_KP_MEMSUBTRACT
KP_MEMMULTIPLYSDL_SCANCODE_KP_MEMMULTIPLY
KP_MEMDIVIDESDL_SCANCODE_KP_MEMDIVIDE
KP_PLUSMINUSSDL_SCANCODE_KP_PLUSMINUS
KP_CLEARSDL_SCANCODE_KP_CLEAR
KP_CLEARENTRYSDL_SCANCODE_KP_CLEARENTRY
KP_BINARYSDL_SCANCODE_KP_BINARY
KP_OCTALSDL_SCANCODE_KP_OCTAL
KP_DECIMALSDL_SCANCODE_KP_DECIMAL
KP_HEXADECIMALSDL_SCANCODE_KP_HEXADECIMAL
LCTRLSDL_SCANCODE_LCTRL
LSHIFTSDL_SCANCODE_LSHIFT
LALTSDL_SCANCODE_LALTalt, option
LGUISDL_SCANCODE_LGUIwindows, command (apple), meta
RCTRLSDL_SCANCODE_RCTRL
RSHIFTSDL_SCANCODE_RSHIFT
RALTSDL_SCANCODE_RALTalt gr, option
RGUISDL_SCANCODE_RGUIwindows, command (apple), meta
MODESDL_SCANCODE_MODEI’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
SLEEPSDL_SCANCODE_SLEEPSleep
WAKESDL_SCANCODE_WAKEWake
CHANNEL_INCREMENTSDL_SCANCODE_CHANNEL_INCREMENTChannel Increment
CHANNEL_DECREMENTSDL_SCANCODE_CHANNEL_DECREMENTChannel Decrement
MEDIA_PLAYSDL_SCANCODE_MEDIA_PLAYPlay
MEDIA_PAUSESDL_SCANCODE_MEDIA_PAUSEPause
MEDIA_RECORDSDL_SCANCODE_MEDIA_RECORDRecord
MEDIA_FAST_FORWARDSDL_SCANCODE_MEDIA_FAST_FORWARDFast Forward
MEDIA_REWINDSDL_SCANCODE_MEDIA_REWINDRewind
MEDIA_NEXT_TRACKSDL_SCANCODE_MEDIA_NEXT_TRACKNext Track
MEDIA_PREVIOUS_TRACKSDL_SCANCODE_MEDIA_PREVIOUS_TRACKPrevious Track
MEDIA_STOPSDL_SCANCODE_MEDIA_STOPStop
MEDIA_EJECTSDL_SCANCODE_MEDIA_EJECTEject
MEDIA_PLAY_PAUSESDL_SCANCODE_MEDIA_PLAY_PAUSEPlay / Pause
MEDIA_SELECTSDL_SCANCODE_MEDIA_SELECT
AC_NEWSDL_SCANCODE_AC_NEWAC New
AC_OPENSDL_SCANCODE_AC_OPENAC Open
AC_CLOSESDL_SCANCODE_AC_CLOSEAC Close
AC_EXITSDL_SCANCODE_AC_EXITAC Exit
AC_SAVESDL_SCANCODE_AC_SAVEAC Save
AC_PRINTSDL_SCANCODE_AC_PRINTAC Print
AC_PROPERTIESSDL_SCANCODE_AC_PROPERTIESAC Properties
AC_SEARCHSDL_SCANCODE_AC_SEARCHAC Search
AC_HOMESDL_SCANCODE_AC_HOMEAC Home
AC_BACKSDL_SCANCODE_AC_BACKAC Back
AC_FORWARDSDL_SCANCODE_AC_FORWARDAC Forward
AC_STOPSDL_SCANCODE_AC_STOPAC Stop
AC_REFRESHSDL_SCANCODE_AC_REFRESHAC Refresh
AC_BOOKMARKSSDL_SCANCODE_AC_BOOKMARKSAC Bookmarks
SOFTLEFTSDL_SCANCODE_SOFTLEFTUsually 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.
SOFTRIGHTSDL_SCANCODE_SOFTRIGHTUsually situated below the display on phones and used as a multi-function feature key for selecting a software defined function shown on the bottom right of the display.
CALLSDL_SCANCODE_CALLUsed for accepting phone calls.
ENDCALLSDL_SCANCODE_ENDCALLUsed for rejecting phone calls.
RESERVEDSDL_SCANCODE_RESERVED400-500 reserved for dynamic keycodes
COUNTSDL_SCANCODE_COUNTnot a key, just marks the number of scancodes for array bounds

Tuple Fields§

§0: i32

Implementations§

§

impl SDL_Scancode

pub const UNKNOWN: SDL_Scancode

pub const A: SDL_Scancode

pub const B: SDL_Scancode

pub const C: SDL_Scancode

pub const D: SDL_Scancode

pub const E: SDL_Scancode

pub const F: SDL_Scancode

pub const G: SDL_Scancode

pub const H: SDL_Scancode

pub const I: SDL_Scancode

pub const J: SDL_Scancode

pub const K: SDL_Scancode

pub const L: SDL_Scancode

pub const M: SDL_Scancode

pub const N: SDL_Scancode

pub const O: SDL_Scancode

pub const P: SDL_Scancode

pub const Q: SDL_Scancode

pub const R: SDL_Scancode

pub const S: SDL_Scancode

pub const T: SDL_Scancode

pub const U: SDL_Scancode

pub const V: SDL_Scancode

pub const W: SDL_Scancode

pub const X: SDL_Scancode

pub const Y: SDL_Scancode

pub const Z: SDL_Scancode

pub const _1: SDL_Scancode

pub const _2: SDL_Scancode

pub const _3: SDL_Scancode

pub const _4: SDL_Scancode

pub const _5: SDL_Scancode

pub const _6: SDL_Scancode

pub const _7: SDL_Scancode

pub const _8: SDL_Scancode

pub const _9: SDL_Scancode

pub const _0: SDL_Scancode

pub const RETURN: SDL_Scancode

pub const ESCAPE: SDL_Scancode

pub const BACKSPACE: SDL_Scancode

pub const TAB: SDL_Scancode

pub const SPACE: SDL_Scancode

pub const MINUS: SDL_Scancode

pub const EQUALS: SDL_Scancode

pub const LEFTBRACKET: SDL_Scancode

pub const RIGHTBRACKET: SDL_Scancode

pub const BACKSLASH: SDL_Scancode

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.

pub const NONUSHASH: SDL_Scancode

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: SDL_Scancode

pub const APOSTROPHE: SDL_Scancode

pub const GRAVE: SDL_Scancode

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: SDL_Scancode

pub const PERIOD: SDL_Scancode

pub const SLASH: SDL_Scancode

pub const CAPSLOCK: SDL_Scancode

pub const F1: SDL_Scancode

pub const F2: SDL_Scancode

pub const F3: SDL_Scancode

pub const F4: SDL_Scancode

pub const F5: SDL_Scancode

pub const F6: SDL_Scancode

pub const F7: SDL_Scancode

pub const F8: SDL_Scancode

pub const F9: SDL_Scancode

pub const F10: SDL_Scancode

pub const F11: SDL_Scancode

pub const F12: SDL_Scancode

pub const PRINTSCREEN: SDL_Scancode

pub const SCROLLLOCK: SDL_Scancode

pub const PAUSE: SDL_Scancode

pub const INSERT: SDL_Scancode

insert on PC, help on some Mac keyboards (but does send code 73, not 117)

pub const HOME: SDL_Scancode

pub const PAGEUP: SDL_Scancode

pub const DELETE: SDL_Scancode

pub const END: SDL_Scancode

pub const PAGEDOWN: SDL_Scancode

pub const RIGHT: SDL_Scancode

pub const LEFT: SDL_Scancode

pub const DOWN: SDL_Scancode

pub const UP: SDL_Scancode

pub const NUMLOCKCLEAR: SDL_Scancode

num lock on PC, clear on Mac keyboards

pub const KP_DIVIDE: SDL_Scancode

pub const KP_MULTIPLY: SDL_Scancode

pub const KP_MINUS: SDL_Scancode

pub const KP_PLUS: SDL_Scancode

pub const KP_ENTER: SDL_Scancode

pub const KP_1: SDL_Scancode

pub const KP_2: SDL_Scancode

pub const KP_3: SDL_Scancode

pub const KP_4: SDL_Scancode

pub const KP_5: SDL_Scancode

pub const KP_6: SDL_Scancode

pub const KP_7: SDL_Scancode

pub const KP_8: SDL_Scancode

pub const KP_9: SDL_Scancode

pub const KP_0: SDL_Scancode

pub const KP_PERIOD: SDL_Scancode

pub const NONUSBACKSLASH: SDL_Scancode

This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. 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.

pub const APPLICATION: SDL_Scancode

windows contextual menu, compose

pub const POWER: SDL_Scancode

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: SDL_Scancode

pub const F13: SDL_Scancode

pub const F14: SDL_Scancode

pub const F15: SDL_Scancode

pub const F16: SDL_Scancode

pub const F17: SDL_Scancode

pub const F18: SDL_Scancode

pub const F19: SDL_Scancode

pub const F20: SDL_Scancode

pub const F21: SDL_Scancode

pub const F22: SDL_Scancode

pub const F23: SDL_Scancode

pub const F24: SDL_Scancode

pub const EXECUTE: SDL_Scancode

pub const HELP: SDL_Scancode

AL Integrated Help Center

pub const MENU: SDL_Scancode

Menu (show menu)

pub const SELECT: SDL_Scancode

pub const STOP: SDL_Scancode

AC Stop

pub const AGAIN: SDL_Scancode

AC Redo/Repeat

pub const UNDO: SDL_Scancode

AC Undo

pub const CUT: SDL_Scancode

AC Cut

pub const COPY: SDL_Scancode

AC Copy

pub const PASTE: SDL_Scancode

AC Paste

pub const FIND: SDL_Scancode

AC Find

pub const MUTE: SDL_Scancode

pub const VOLUMEUP: SDL_Scancode

pub const VOLUMEDOWN: SDL_Scancode

pub const KP_COMMA: SDL_Scancode

pub const KP_EQUALSAS400: SDL_Scancode

pub const INTERNATIONAL1: SDL_Scancode

used on Asian keyboards, see footnotes in USB doc

pub const INTERNATIONAL2: SDL_Scancode

pub const INTERNATIONAL3: SDL_Scancode

Yen

pub const INTERNATIONAL4: SDL_Scancode

pub const INTERNATIONAL5: SDL_Scancode

pub const INTERNATIONAL6: SDL_Scancode

pub const INTERNATIONAL7: SDL_Scancode

pub const INTERNATIONAL8: SDL_Scancode

pub const INTERNATIONAL9: SDL_Scancode

pub const LANG1: SDL_Scancode

Hangul/English toggle

pub const LANG2: SDL_Scancode

Hanja conversion

pub const LANG3: SDL_Scancode

Katakana

pub const LANG4: SDL_Scancode

Hiragana

pub const LANG5: SDL_Scancode

Zenkaku/Hankaku

pub const LANG6: SDL_Scancode

reserved

pub const LANG7: SDL_Scancode

reserved

pub const LANG8: SDL_Scancode

reserved

pub const LANG9: SDL_Scancode

reserved

pub const ALTERASE: SDL_Scancode

Erase-Eaze

pub const SYSREQ: SDL_Scancode

pub const CANCEL: SDL_Scancode

AC Cancel

pub const CLEAR: SDL_Scancode

pub const PRIOR: SDL_Scancode

pub const RETURN2: SDL_Scancode

pub const SEPARATOR: SDL_Scancode

pub const OUT: SDL_Scancode

pub const OPER: SDL_Scancode

pub const CLEARAGAIN: SDL_Scancode

pub const CRSEL: SDL_Scancode

pub const EXSEL: SDL_Scancode

pub const KP_00: SDL_Scancode

pub const KP_000: SDL_Scancode

pub const THOUSANDSSEPARATOR: SDL_Scancode

pub const DECIMALSEPARATOR: SDL_Scancode

pub const CURRENCYUNIT: SDL_Scancode

pub const CURRENCYSUBUNIT: SDL_Scancode

pub const KP_LEFTPAREN: SDL_Scancode

pub const KP_RIGHTPAREN: SDL_Scancode

pub const KP_LEFTBRACE: SDL_Scancode

pub const KP_RIGHTBRACE: SDL_Scancode

pub const KP_TAB: SDL_Scancode

pub const KP_BACKSPACE: SDL_Scancode

pub const KP_A: SDL_Scancode

pub const KP_B: SDL_Scancode

pub const KP_C: SDL_Scancode

pub const KP_D: SDL_Scancode

pub const KP_E: SDL_Scancode

pub const KP_F: SDL_Scancode

pub const KP_XOR: SDL_Scancode

pub const KP_POWER: SDL_Scancode

pub const KP_PERCENT: SDL_Scancode

pub const KP_LESS: SDL_Scancode

pub const KP_GREATER: SDL_Scancode

pub const KP_AMPERSAND: SDL_Scancode

pub const KP_DBLAMPERSAND: SDL_Scancode

pub const KP_VERTICALBAR: SDL_Scancode

pub const KP_DBLVERTICALBAR: SDL_Scancode

pub const KP_COLON: SDL_Scancode

pub const KP_HASH: SDL_Scancode

pub const KP_SPACE: SDL_Scancode

pub const KP_AT: SDL_Scancode

pub const KP_EXCLAM: SDL_Scancode

pub const KP_MEMSTORE: SDL_Scancode

pub const KP_MEMRECALL: SDL_Scancode

pub const KP_MEMCLEAR: SDL_Scancode

pub const KP_MEMADD: SDL_Scancode

pub const KP_MEMSUBTRACT: SDL_Scancode

pub const KP_MEMMULTIPLY: SDL_Scancode

pub const KP_MEMDIVIDE: SDL_Scancode

pub const KP_PLUSMINUS: SDL_Scancode

pub const KP_CLEAR: SDL_Scancode

pub const KP_CLEARENTRY: SDL_Scancode

pub const KP_BINARY: SDL_Scancode

pub const KP_OCTAL: SDL_Scancode

pub const KP_DECIMAL: SDL_Scancode

pub const KP_HEXADECIMAL: SDL_Scancode

pub const LCTRL: SDL_Scancode

pub const LSHIFT: SDL_Scancode

pub const LALT: SDL_Scancode

alt, option

pub const LGUI: SDL_Scancode

windows, command (apple), meta

pub const RCTRL: SDL_Scancode

pub const RSHIFT: SDL_Scancode

pub const RALT: SDL_Scancode

alt gr, option

pub const RGUI: SDL_Scancode

windows, command (apple), meta

pub const MODE: SDL_Scancode

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

pub const SLEEP: SDL_Scancode

Sleep

pub const WAKE: SDL_Scancode

Wake

pub const CHANNEL_INCREMENT: SDL_Scancode

Channel Increment

pub const CHANNEL_DECREMENT: SDL_Scancode

Channel Decrement

pub const MEDIA_PLAY: SDL_Scancode

Play

pub const MEDIA_PAUSE: SDL_Scancode

Pause

pub const MEDIA_RECORD: SDL_Scancode

Record

pub const MEDIA_FAST_FORWARD: SDL_Scancode

Fast Forward

pub const MEDIA_REWIND: SDL_Scancode

Rewind

pub const MEDIA_NEXT_TRACK: SDL_Scancode

Next Track

pub const MEDIA_PREVIOUS_TRACK: SDL_Scancode

Previous Track

pub const MEDIA_STOP: SDL_Scancode

Stop

pub const MEDIA_EJECT: SDL_Scancode

Eject

pub const MEDIA_PLAY_PAUSE: SDL_Scancode

Play / Pause

pub const MEDIA_SELECT: SDL_Scancode

pub const AC_NEW: SDL_Scancode

AC New

pub const AC_OPEN: SDL_Scancode

AC Open

pub const AC_CLOSE: SDL_Scancode

AC Close

pub const AC_EXIT: SDL_Scancode

AC Exit

pub const AC_SAVE: SDL_Scancode

AC Save

pub const AC_PRINT: SDL_Scancode

AC Print

pub const AC_PROPERTIES: SDL_Scancode

AC Properties

AC Search

pub const AC_HOME: SDL_Scancode

AC Home

pub const AC_BACK: SDL_Scancode

AC Back

pub const AC_FORWARD: SDL_Scancode

AC Forward

pub const AC_STOP: SDL_Scancode

AC Stop

pub const AC_REFRESH: SDL_Scancode

AC Refresh

pub const AC_BOOKMARKS: SDL_Scancode

AC Bookmarks

pub const SOFTLEFT: SDL_Scancode

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.

pub const SOFTRIGHT: SDL_Scancode

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 right of the display.

pub const CALL: SDL_Scancode

Used for accepting phone calls.

pub const ENDCALL: SDL_Scancode

Used for rejecting phone calls.

pub const RESERVED: SDL_Scancode

400-500 reserved for dynamic keycodes

pub const COUNT: SDL_Scancode

not a key, just marks the number of scancodes for array bounds

Trait Implementations§

§

impl Clone for SDL_Scancode

§

fn clone(&self) -> SDL_Scancode

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

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

Performs copy-assignment from source. Read more
§

impl Default for SDL_Scancode

§

fn default() -> SDL_Scancode

Returns the “default value” for a type. Read more
§

impl From<SDL_Scancode> for i32

§

fn from(value: SDL_Scancode) -> i32

Converts to this type from the input type.
§

impl From<Scancode> for SDL_Scancode

§

fn from(scancode: Scancode) -> SDL_Scancode

Converts to this type from the input type.
§

impl Hash for SDL_Scancode

§

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

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
§

impl Ord for SDL_Scancode

§

fn cmp(&self, other: &SDL_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
§

impl PartialEq for SDL_Scancode

§

fn eq(&self, other: &SDL_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.
§

impl PartialOrd for SDL_Scancode

§

fn partial_cmp(&self, other: &SDL_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
§

impl Copy for SDL_Scancode

§

impl Eq for SDL_Scancode

§

impl StructuralPartialEq for SDL_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> ByteSized for T

Source§

const BYTE_ALIGN: usize = _

The alignment of this type in bytes.
Source§

const BYTE_SIZE: usize = _

The size of this type in bytes.
Source§

fn byte_align(&self) -> usize

Returns the alignment of this type in bytes.
Source§

fn byte_size(&self) -> usize

Returns the size of this type in bytes. Read more
Source§

fn ptr_size_ratio(&self) -> [usize; 2]

Returns the size ratio between Ptr::BYTES and BYTE_SIZE. Read more
Source§

impl<T, R> Chain<R> for T
where T: ?Sized,

Source§

fn chain<F>(self, f: F) -> R
where F: FnOnce(Self) -> R, Self: Sized,

Chain a function which takes the parameter by value.
Source§

fn chain_ref<F>(&self, f: F) -> R
where F: FnOnce(&Self) -> R,

Chain a function which takes the parameter by shared reference.
Source§

fn chain_mut<F>(&mut self, f: F) -> R
where F: FnOnce(&mut Self) -> R,

Chain a function which takes the parameter by exclusive reference.
Source§

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

Source§

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

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

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

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

Source§

fn type_id() -> TypeId

Returns the TypeId of Self. Read more
Source§

fn type_of(&self) -> TypeId

Returns the TypeId of self. Read more
Source§

fn type_name(&self) -> &'static str

Returns the type name of self. Read more
Source§

fn type_is<T: 'static>(&self) -> bool

Returns true if Self is of type T. Read more
Source§

fn type_hash(&self) -> u64

Returns a deterministic hash of the TypeId of Self.
Source§

fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64

Returns a deterministic hash of the TypeId of Self using a custom hasher.
Source§

fn as_any_ref(&self) -> &dyn Any
where Self: Sized,

Upcasts &self as &dyn Any. Read more
Source§

fn as_any_mut(&mut self) -> &mut dyn Any
where Self: Sized,

Upcasts &mut self as &mut dyn Any. Read more
Source§

fn as_any_box(self: Box<Self>) -> Box<dyn Any>
where Self: Sized,

Upcasts Box<self> as Box<dyn Any>. Read more
Source§

fn downcast_ref<T: 'static>(&self) -> Option<&T>

Available on crate feature unsafe_layout only.
Returns some shared reference to the inner value if it is of type T. Read more
Source§

fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T>

Available on crate feature unsafe_layout only.
Returns some exclusive reference to the inner value if it is of type T. Read more
Source§

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

Source§

const NEEDS_DROP: bool = _

Know whether dropping values of this type matters, in compile-time.
Source§

fn mem_align_of<T>() -> usize

Returns the minimum alignment of the type in bytes. Read more
Source§

fn mem_align_of_val(&self) -> usize

Returns the alignment of the pointed-to value in bytes. Read more
Source§

fn mem_size_of<T>() -> usize

Returns the size of a type in bytes. Read more
Source§

fn mem_size_of_val(&self) -> usize

Returns the size of the pointed-to value in bytes. Read more
Source§

fn mem_copy(&self) -> Self
where Self: Copy,

Bitwise-copies a value. Read more
Source§

fn mem_needs_drop(&self) -> bool

Returns true if dropping values of this type matters. Read more
Source§

fn mem_drop(self)
where Self: Sized,

Drops self by running its destructor. Read more
Source§

fn mem_forget(self)
where Self: Sized,

Forgets about self without running its destructor. Read more
Source§

fn mem_replace(&mut self, other: Self) -> Self
where Self: Sized,

Replaces self with other, returning the previous value of self. Read more
Source§

fn mem_take(&mut self) -> Self
where Self: Default,

Replaces self with its default value, returning the previous value of self. Read more
Source§

fn mem_swap(&mut self, other: &mut Self)
where Self: Sized,

Swaps the value of self and other without deinitializing either one. Read more
Source§

unsafe fn mem_zeroed<T>() -> T

Available on crate feature unsafe_layout only.
Returns the value of type T represented by the all-zero byte-pattern. Read more
Source§

unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst

Available on crate feature unsafe_layout only.
Returns the value of type T represented by the all-zero byte-pattern. Read more
Source§

fn mem_as_bytes(&self) -> &[u8]
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &[u8]. Read more
Source§

fn mem_as_bytes_mut(&mut self) -> &mut [u8]
where Self: Sync + Unpin,

Available on crate feature unsafe_slice only.
View a Sync + Unpin self as &mut [u8]. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

Source§

impl<T> Hook for T

Source§

fn hook_ref<F>(self, f: F) -> Self
where F: FnOnce(&Self),

Applies a function which takes the parameter by shared reference, and then returns the (possibly) modified owned value. Read more
Source§

fn hook_mut<F>(self, f: F) -> Self
where F: FnOnce(&mut Self),

Applies a function which takes the parameter by exclusive reference, and then returns the (possibly) modified owned value. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> Ungil for T
where T: Send,