"\" (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.)

"`" (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.)

SDL_SCANCODE_GRAVE

SDLK_BACKQUOTE

"H"

SDL_SCANCODE_H

SDLK_h

"Help"

SDL_SCANCODE_HELP

SDLK_HELP

"Home"

SDL_SCANCODE_HOME

SDLK_HOME

"I"

SDL_SCANCODE_I

SDLK_i

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

SDL_SCANCODE_INSERT

SDLK_INSERT

"J"

SDL_SCANCODE_J

SDLK_j

"K"

SDL_SCANCODE_K

SDLK_k

"KBDIllumDown" (the Keyboard Illumination Down key)

SDL_SCANCODE_KBDILLUMDOWN

SDLK_KBDILLUMDOWN

"KBDIllumToggle" (the Keyboard Illumination Toggle key)

SDL_SCANCODE_KBDILLUMTOGGLE

SDLK_KBDILLUMTOGGLE

"KBDIllumUp" (the Keyboard Illumination Up key)

SDL_SCANCODE_KBDILLUMUP

SDLK_KBDILLUMUP

"Keypad 0" (the 0 key (numeric keypad))

SDL_SCANCODE_KP_0

SDLK_KP_0

"Keypad 00" (the 00 key (numeric keypad))

SDL_SCANCODE_KP_00

SDLK_KP_00

"Keypad 000" (the 000 key (numeric keypad))

SDL_SCANCODE_KP_000

SDLK_KP_000

"Keypad 1" (the 1 key (numeric keypad))

SDL_SCANCODE_KP_1

SDLK_KP_1

"Keypad 2" (the 2 key (numeric keypad))

SDL_SCANCODE_KP_2

SDLK_KP_2

"Keypad 3" (the 3 key (numeric keypad))

SDL_SCANCODE_KP_3

SDLK_KP_3

"Keypad 4" (the 4 key (numeric keypad))

SDL_SCANCODE_KP_4

SDLK_KP_4

"Keypad 5" (the 5 key (numeric keypad))

SDL_SCANCODE_KP_5

SDLK_KP_5

"Keypad 6" (the 6 key (numeric keypad))

SDL_SCANCODE_KP_6

SDLK_KP_6

"Keypad 7" (the 7 key (numeric keypad))

SDL_SCANCODE_KP_7

SDLK_KP_7

"Keypad 8" (the 8 key (numeric keypad))

SDL_SCANCODE_KP_8

SDLK_KP_8

"Keypad 9" (the 9 key (numeric keypad))

SDL_SCANCODE_KP_9

SDLK_KP_9

"Keypad A" (the A key (numeric keypad))

SDL_SCANCODE_KP_A

SDLK_KP_A

"Keypad &" (the & key (numeric keypad))

SDL_SCANCODE_KP_AMPERSAND

SDLK_KP_AMPERSAND

"Keypad @" (the @ key (numeric keypad))

SDL_SCANCODE_KP_AT

SDLK_KP_AT

"Keypad B" (the B key (numeric keypad))

SDL_SCANCODE_KP_B

SDLK_KP_B

"Keypad Backspace" (the Backspace key (numeric keypad))

SDL_SCANCODE_KP_BACKSPACE

SDLK_KP_BACKSPACE

"Keypad Binary" (the Binary key (numeric keypad))

SDL_SCANCODE_KP_BINARY

SDLK_KP_BINARY

"Keypad C" (the C key (numeric keypad))

SDL_SCANCODE_KP_C

SDLK_KP_C

"Keypad Clear" (the Clear key (numeric keypad))

SDL_SCANCODE_KP_CLEAR

SDLK_KP_CLEAR

"Keypad ClearEntry" (the Clear Entry key (numeric keypad))

SDL_SCANCODE_KP_CLEARENTRY

SDLK_KP_CLEARENTRY

"Keypad :" (the : key (numeric keypad))

SDL_SCANCODE_KP_COLON

SDLK_KP_COLON

"Keypad ," (the Comma key (numeric keypad))

SDL_SCANCODE_KP_COMMA

SDLK_KP_COMMA

"Keypad D" (the D key (numeric keypad))

SDL_SCANCODE_KP_D

SDLK_KP_D

"Keypad &&" (the && key (numeric keypad))

SDL_SCANCODE_KP_DBLAMPERSAND

SDLK_KP_DBLAMPERSAND

"Keypad ||" (the || key (numeric keypad))

SDL_SCANCODE_KP_DBLVERTICALBAR

SDLK_KP_DBLVERTICALBAR

"Keypad Decimal" (the Decimal key (numeric keypad))

SDL_SCANCODE_KP_DECIMAL

SDLK_KP_DECIMAL

"Keypad /" (the / key (numeric keypad))

SDL_SCANCODE_KP_DIVIDE

SDLK_KP_DIVIDE

"Keypad E" (the E key (numeric keypad))

SDL_SCANCODE_KP_E

SDLK_KP_E

"Keypad Enter" (the Enter key (numeric keypad))

SDL_SCANCODE_KP_ENTER

SDLK_KP_ENTER

"Keypad =" (the = key (numeric keypad))

SDL_SCANCODE_KP_EQUALS

SDLK_KP_EQUALS

"Keypad = (AS400)" (the Equals AS400 key (numeric keypad))

SDL_SCANCODE_KP_EQUALSAS400

SDLK_KP_EQUALSAS400

"Keypad !" (the ! key (numeric keypad))

SDL_SCANCODE_KP_EXCLAM

SDLK_KP_EXCLAM

"Keypad F" (the F key (numeric keypad))

SDL_SCANCODE_KP_F

SDLK_KP_F

"Keypad >" (the Greater key (numeric keypad))

SDL_SCANCODE_KP_GREATER

SDLK_KP_GREATER

"Keypad #" (the # key (numeric keypad))

SDL_SCANCODE_KP_HASH

SDLK_KP_HASH

"Keypad Hexadecimal" (the Hexadecimal key (numeric keypad))

SDL_SCANCODE_KP_HEXADECIMAL

SDLK_KP_HEXADECIMAL

"Keypad {" (the Left Brace key (numeric keypad))

SDL_SCANCODE_KP_LEFTBRACE

SDLK_KP_LEFTBRACE

"Keypad (" (the Left Parenthesis key (numeric keypad))

SDL_SCANCODE_KP_LEFTPAREN

SDLK_KP_LEFTPAREN

"Keypad <" (the Less key (numeric keypad))

SDL_SCANCODE_KP_LESS

SDLK_KP_LESS

"Keypad MemAdd" (the Mem Add key (numeric keypad))

SDL_SCANCODE_KP_MEMADD

SDLK_KP_MEMADD

"Keypad MemClear" (the Mem Clear key (numeric keypad))

SDL_SCANCODE_KP_MEMCLEAR

SDLK_KP_MEMCLEAR

"Keypad MemDivide" (the Mem Divide key (numeric keypad))

SDL_SCANCODE_KP_MEMDIVIDE

SDLK_KP_MEMDIVIDE

"Keypad MemMultiply" (the Mem Multiply key (numeric keypad))

SDL_SCANCODE_KP_MEMMULTIPLY

SDLK_KP_MEMMULTIPLY

"Keypad MemRecall" (the Mem Recall key (numeric keypad))

SDL_SCANCODE_KP_MEMRECALL

SDLK_KP_MEMRECALL

"Keypad MemStore" (the Mem Store key (numeric keypad))

SDL_SCANCODE_KP_MEMSTORE

SDLK_KP_MEMSTORE

"Keypad MemSubtract" (the Mem Subtract key (numeric keypad))

SDL_SCANCODE_KP_MEMSUBTRACT

SDLK_KP_MEMSUBTRACT

"Keypad -" (the - key (numeric keypad))

SDL_SCANCODE_KP_MINUS

SDLK_KP_MINUS

"Keypad *" (the * key (numeric keypad))

SDL_SCANCODE_KP_MULTIPLY

SDLK_KP_MULTIPLY

"Keypad Octal" (the Octal key (numeric keypad))

SDL_SCANCODE_KP_OCTAL

SDLK_KP_OCTAL

"Keypad %" (the Percent key (numeric keypad))

SDL_SCANCODE_KP_PERCENT

SDLK_KP_PERCENT

"Keypad ." (the . key (numeric keypad))

SDL_SCANCODE_KP_PERIOD

SDLK_KP_PERIOD

"Keypad +" (the + key (numeric keypad))

SDL_SCANCODE_KP_PLUS

SDLK_KP_PLUS

"Keypad +/-" (the +/- key (numeric keypad))

SDL_SCANCODE_KP_PLUSMINUS

SDLK_KP_PLUSMINUS

"Keypad ^" (the Power key (numeric keypad))

SDL_SCANCODE_KP_POWER

SDLK_KP_POWER

"Keypad }" (the Right Brace key (numeric keypad))

SDL_SCANCODE_KP_RIGHTBRACE

SDLK_KP_RIGHTBRACE

"Keypad )" (the Right Parenthesis key (numeric keypad))

SDL_SCANCODE_KP_RIGHTPAREN

SDLK_KP_RIGHTPAREN

"Keypad Space" (the Space key (numeric keypad))

SDL_SCANCODE_KP_SPACE

SDLK_KP_SPACE

"Keypad Tab" (the Tab key (numeric keypad))

SDL_SCANCODE_KP_TAB

SDLK_KP_TAB

"Keypad |" (the | key (numeric keypad))

SDL_SCANCODE_KP_VERTICALBAR

SDLK_KP_VERTICALBAR

"Keypad XOR" (the XOR key (numeric keypad))

SDL_SCANCODE_KP_XOR

SDLK_KP_XOR

"L"

SDL_SCANCODE_L

SDLK_l

"Left Alt" (alt, option)

SDL_SCANCODE_LALT

SDLK_LALT

"Left Ctrl"

SDL_SCANCODE_LCTRL

SDLK_LCTRL

"Left" (the Left arrow key (navigation keypad))

SDL_SCANCODE_LEFT

SDLK_LEFT

"["

SDL_SCANCODE_LEFTBRACKET

SDLK_LEFTBRACKET

"Left GUI" (windows, command (apple), meta)

SDL_SCANCODE_LGUI

SDLK_LGUI

"Left Shift"

SDL_SCANCODE_LSHIFT

SDLK_LSHIFT

"M"

SDL_SCANCODE_M

SDLK_m

"Mail" (the Mail/eMail key)

SDL_SCANCODE_MAIL

SDLK_MAIL

"MediaSelect" (the Media Select key)

SDL_SCANCODE_MEDIASELECT

SDLK_MEDIASELECT

"Menu"

SDL_SCANCODE_MENU

SDLK_MENU

"-"

SDL_SCANCODE_MINUS

SDLK_MINUS

"ModeSwitch" (I'm not sure if this is really not covered by any of the above, but since there's a special KMOD_MODE for it I'm adding it here)

SDL_SCANCODE_MODE

SDLK_MODE

"Mute"

SDL_SCANCODE_MUTE

SDLK_MUTE

"N"

SDL_SCANCODE_N

SDLK_n

"Numlock" (the Num Lock key (PC) / the Clear key (Mac))

SDL_SCANCODE_NUMLOCKCLEAR

SDLK_NUMLOCKCLEAR

"O"

SDL_SCANCODE_O

SDLK_o

"Oper"

SDL_SCANCODE_OPER

SDLK_OPER

"Out"

SDL_SCANCODE_OUT

SDLK_OUT

"P"

SDL_SCANCODE_P

SDLK_p

"PageDown"

SDL_SCANCODE_PAGEDOWN

SDLK_PAGEDOWN

"PageUp"

SDL_SCANCODE_PAGEUP

SDLK_PAGEUP

"Paste"

SDL_SCANCODE_PASTE

SDLK_PASTE

"Pause" (the Pause / Break key)

SDL_SCANCODE_PAUSE

SDLK_PAUSE

"."

SDL_SCANCODE_PERIOD

SDLK_PERIOD

"Power" (The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key.)

"" (no name, empty string; 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.)

SDL_SCANCODE_NONUSBACKSLASH

(none)

"#" (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.)

SDL_SCANCODE_NONUSHASH

(none)

These virtual key values do not have corresponding physical keys

"&"

(none)

SDLK_AMPERSAND

"*"

(none)

SDLK_ASTERISK

"@"

(none)

SDLK_AT

"^"

(none)

SDLK_CARET

":"

(none)

SDLK_COLON

"$"

(none)

SDLK_DOLLAR

"!"

(none)

SDLK_EXCLAIM

">"

(none)

SDLK_GREATER

"#"

(none)

SDLK_HASH

"("

(none)

SDLK_LEFTPAREN

"<"

(none)

SDLK_LESS

"%"

(none)

SDLK_PERCENT

"+"

(none)

SDLK_PLUS

"?"

(none)

SDLK_QUESTION

"""

(none)

SDLK_QUOTEDBL

")"

(none)

SDLK_RIGHTPAREN

"_"

(none)

SDLK_UNDERSCORE

Code Examples

/* checks if a key is being remapped and prints what the remapping is */if(event->key.keysym.scancode!=SDL_GetScancodeFromKey(event->key.keysym.sym)){SDL_Log("Physical %s key acting as %s key",SDL_GetScancodeName(event->key.keysym.scancode),SDL_GetKeyName(event->key.keysym.sym));}

Remarks

Values of this type are used to represent the physical location of a keyboard key on the keyboard. This is correlated to the SDL_Keycode associated with that location to give a key press meaning.

These are used in many places, including Values of this type are used to represent keyboard keys, among other places in the SDL_keysym::scancodekey.keysym.scancode field of the SDL_Event structure.

The values in this enumeration are based on the USB usage page standard: