|
Size: 10280
Comment: add content (in progress)
|
← Revision 30 as of 2013-09-01 18:33:04 ⇥
Size: 2140
Comment: Updated usage of Color2 macro.
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 2: | Line 2: |
| #pragma disable-camelcase | #pragma camelcase off |
| Line 5: | Line 5: |
| = SDLKey = | = SDL_Keycode = |
| Line 11: | Line 11: |
| ||SDLK_UNKNOWN||0|| ||SDLK_RETURN||the Enter key (main keyboard)|| ||SDLK_ESCAPE||the Esc key|| ||SDLK_TAB||the Tab key|| ||SDLK_CAPSLOCK||the Caps Lock key|| ||SDLK_LSHIFT||the Left Shift key|| ||SDLK_LCTRL||the Left Control key|| ||SDLK_LGUI||the Left GUI key|| ||SDLK_LALT||the Left Alt key|| ||SDLK_SPACE||the Space Bar key(s)|| ||SDLK_RALT||the Right Alt key|| ||SDLK_RGUI||the Right GUI key|| ||SDLK_APPLICATION||the Application / Contextual Menu key (Windows)|| ||SDLK_RCTRL||the Right Control key|| ||SDLK_RSHIFT||the Right Shift key|| ||SDLK_BACKQUOTE||the ` key|| ||SDLK_EXCLAIM||the ! key|| ||SDLK_AT||the @ key|| ||SDLK_HASH||the # key|| ||SDLK_DOLLAR||the $ key|| ||SDLK_PERCENT||the % key|| ||SDLK_CARET||the ^ key|| ||SDLK_AMPERSAND||the & key|| ||SDLK_ASTERISK||the * key|| ||SDLK_LEFTPAREN||the ( key|| ||SDLK_RIGHTPAREN||the ) key|| ||SDLK_MINUS||the - key|| ||SDLK_EQUALS||the = key|| ||SDLK_BACKSPACE||the Back Space key|| ||SDLK_UNDERSCORE||the _ key|| ||SDLK_PLUS||the + key|| ||SDLK_LEFTBRACKET||the [ key|| ||SDLK_RIGHTBRACKET||the ] key|| ||SDLK_SEMICOLON||the ; key|| ||SDLK_QUOTE||the ' key|| ||SDLK_COLON||the : key|| ||SDLK_QUOTEDBL||the " key|| ||SDLK_COMMA||the , key|| ||SDLK_PERIOD||the . key|| ||SDLK_SLASH||the / key|| ||SDLK_BACKSLASH||the \ key|| ||SDLK_LESS||the < key|| ||SDLK_GREATER||the > key|| ||SDLK_QUESTION||the ? key|| ||SDLK_0||the 0 key|| ||SDLK_1||the 1 key|| ||SDLK_2||the 2 key|| ||SDLK_3||the 3 key|| ||SDLK_4||the 4 key|| ||SDLK_5||the 5 key|| ||SDLK_6||the 6 key|| ||SDLK_7||the 7 key|| ||SDLK_8||the 8 key|| ||SDLK_9||the 9 key|| ||SDLK_a||the a key|| ||SDLK_b||the b key|| ||SDLK_c||the c key|| ||SDLK_d||the d key|| ||SDLK_e||the e key|| ||SDLK_f||the f key|| ||SDLK_g||the g key|| ||SDLK_h||the h key|| ||SDLK_i||the i key|| ||SDLK_j||the j key|| ||SDLK_k||the k key|| ||SDLK_l||the l key|| ||SDLK_m||the m key|| ||SDLK_n||the n key|| ||SDLK_o||the o key|| ||SDLK_p||the p key|| ||SDLK_q||the q key|| ||SDLK_r||the r key|| ||SDLK_s||the s key|| ||SDLK_t||the t key|| ||SDLK_u||the u key|| ||SDLK_v||the v key|| ||SDLK_w||the w key|| ||SDLK_x||the x key|| ||SDLK_y||the y key|| ||SDLK_z||the z key|| ||SDLK_F1||the F1 key|| ||SDLK_F2||the F2 key|| ||SDLK_F3||the F3 key|| ||SDLK_F4||the F4 key|| ||SDLK_F5||the F5 key|| ||SDLK_F6||the F6 key|| ||SDLK_F7||the F7 key|| ||SDLK_F8||the F8 key|| ||SDLK_F9||the F9 key|| ||SDLK_F10||the F10 key|| ||SDLK_F11||the F11 key|| ||SDLK_F12||the F12 key|| ||SDLK_PRINTSCREEN||the Print Screen key|| ||SDLK_SCROLLLOCK||the Scroll Lock key|| ||SDLK_PAUSE||the Pause / Break key|| ||SDLK_SYSREQ||the !SysReq key|| ||SDLK_INSERT||the Insert key|| ||SDLK_DELETE||the Delete key|| ||SDLK_HOME||the Home key|| ||SDLK_END||the End key|| ||SDLK_PAGEUP||the Page Up key|| ||SDLK_PAGEDOWN||the Page Down key|| ||SDLK_LEFT||the Left arrow key (navigation keypad)|| ||SDLK_RIGHT||the Right arrow key (navigation keypad)|| ||SDLK_UP||the Up arrow key (navigation keypad)|| ||SDLK_DOWN||the Down arrow key (navigation keypad)|| ||SDLK_POWER||the Power key|| ||SDLK_SLEEP||the Sleep key|| ||SDLK_NUMLOCKCLEAR||the Num Lock key (PC) / the Clear key (Mac)|| ||SDLK_KP_DIVIDE||the / key (numeric keypad)|| ||SDLK_KP_MULTIPLY||the * key (numeric keypad)|| ||SDLK_KP_MINUS||the - key (numeric keypad)|| ||SDLK_KP_PLUS||the + key (numeric keypad)|| ||SDLK_KP_ENTER||the Enter key (numeric keypad)|| ||SDLK_KP_1||the 1 key (numeric keypad)|| ||SDLK_KP_2||the 2 key (numeric keypad)|| ||SDLK_KP_3||the 3 key (numeric keypad)|| ||SDLK_KP_4||the 4 key (numeric keypad)|| ||SDLK_KP_5||the 5 key (numeric keypad)|| ||SDLK_KP_6||the 6 key (numeric keypad)|| ||SDLK_KP_7||the 7 key (numeric keypad)|| ||SDLK_KP_8||the 8 key (numeric keypad)|| ||SDLK_KP_9||the 9 key (numeric keypad)|| ||SDLK_KP_0||the 0 key (numeric keypad)|| ||SDLK_KP_PERIOD||the . key (numeric keypad)|| ||SDLK_F13||the F13 key|| ||SDLK_F14||the F14 key|| ||SDLK_F15||the F15 key|| ||SDLK_F16||the F16 key|| ||SDLK_F17||the F17 key|| ||SDLK_F18||the F18 key|| ||SDLK_F19||the F19 key|| ||SDLK_F20||the F20 key|| ||SDLK_F21||the F21 key|| ||SDLK_F22||the F22 key|| ||SDLK_F23||the F23 key|| ||SDLK_F24||the F24 key|| ||SDLK_EXECUTE||the Execute key|| ||SDLK_HELP||the Help key|| ||SDLK_MENU||the Menu key|| ||SDLK_SELECT||the Select key|| ||SDLK_STOP||the Stop key|| ||SDLK_AGAIN||the Again key|| ||SDLK_UNDO||the Undo key|| ||SDLK_CUT||the Cut key|| ||SDLK_COPY||the Copy key|| ||SDLK_PASTE||the Paste key|| ||SDLK_FIND||the Find key|| ||SDLK_MUTE||the Mute key|| ||SDLK_VOLUMEUP||the Volume Up key|| ||SDLK_VOLUMEDOWN||the Volume Down key|| ||SDLK_ALTERASE||the Alt Erase key|| ||SDLK_CANCEL||the Cancel key|| ||SDLK_CLEAR||the Clear key|| ||SDLK_PRIOR||the Prior key|| ||SDLK_RETURN2||the Return2 key|| ||SDLK_SEPARATOR||the Separator key|| ||SDLK_OUT||the Out key|| ||SDLK_OPER||the Oper key|| ||SDLK_CLEARAGAIN||the Clear Again key|| ||SDLK_CRSEL||the Cr``Sel key|| ||SDLK_EXSEL||the Ex``Sel key|| ||SDLK_THOUSANDSSEPARATOR||the Thousands Separator key|| ||SDLK_DECIMALSEPARATOR||the Decimal Separator key|| ||SDLK_CURRENCYUNIT||the Currency Unit key|| ||SDLK_CURRENCYSUBUNIT||the Currency Subunit key|| ||SDLK_KP_EQUALS||the = key (numeric keypad)|| ||SDLK_KP_COMMA||the Comma key (numeric keypad)|| ||SDLK_KP_EQUALSAS400||the Equals AS400 key (numeric keypad)|| ||SDLK_KP_00||the 00 key (numeric keypad)|| ||SDLK_KP_000||the 000 key (numeric keypad)|| ||SDLK_KP_LEFTPAREN||the Left Parenthesis key (numeric keypad)|| ||SDLK_KP_RIGHTPAREN||the Right Parenthesis key (numeric keypad)|| ||SDLK_KP_LEFTBRACE||the Left Brace key (numeric keypad)|| ||SDLK_KP_RIGHTBRACE||the Right Brace key (numeric keypad)|| ||SDLK_KP_TAB||the Tab key (numeric keypad)|| ||SDLK_KP_BACKSPACE||the Backspace key (numeric keypad)|| ||SDLK_KP_A||the A key (numeric keypad)|| ||SDLK_KP_B||the B key (numeric keypad)|| ||SDLK_KP_C||the C key (numeric keypad)|| ||SDLK_KP_D||the D key (numeric keypad)|| ||SDLK_KP_E||the E key (numeric keypad)|| ||SDLK_KP_F||the F key (numeric keypad)|| ||SDLK_KP_XOR||the XOR key (numeric keypad)|| ||SDLK_KP_POWER||the Power key (numeric keypad)|| ||SDLK_KP_PERCENT||the Percent key (numeric keypad)|| ||SDLK_KP_LESS||the Less key (numeric keypad)|| ||SDLK_KP_GREATER||the Greater key (numeric keypad)|| ||SDLK_KP_AMPERSAND||the & key (numeric keypad)|| ||SDLK_KP_DBLAMPERSAND||the && key (numeric keypad)|| ||SDLK_KP_VERTICALBAR||the `|` key (numeric keypad)|| ||SDLK_KP_DBLVERTICALBAR||the `||` key (numeric keypad)|| ||SDLK_KP_COLON||the : key (numeric keypad)|| ||SDLK_KP_HASH||the # key (numeric keypad)|| ||SDLK_KP_SPACE||the Space key (numeric keypad)|| ||SDLK_KP_AT||the @ key (numeric keypad)|| ||SDLK_KP_EXCLAM||the ! key (numeric keypad)|| ||SDLK_KP_MEMSTORE||the Mem Store key (numeric keypad)|| ||SDLK_KP_MEMRECALL||the Mem Recall key (numeric keypad)|| ||SDLK_KP_MEMCLEAR||the Mem Clear key (numeric keypad)|| ||SDLK_KP_MEMADD||the Mem Add key (numeric keypad)|| ||SDLK_KP_MEMSUBTRACT||the Mem Subtract key (numeric keypad)|| ||SDLK_KP_MEMMULTIPLY||the Mem Multiply key (numeric keypad)|| ||SDLK_KP_MEMDIVIDE||the Mem Divide key (numeric keypad)|| ||SDLK_KP_PLUSMINUS||the +/- key (numeric keypad)|| ||SDLK_KP_CLEAR||the Clear key (numeric keypad)|| ||SDLK_KP_CLEARENTRY||the Clear Entry key (numeric keypad)|| ||SDLK_KP_BINARY||the Binary key (numeric keypad)|| ||SDLK_KP_OCTAL||the Octal key (numeric keypad)|| ||SDLK_KP_DECIMAL||the Decimal key (numeric keypad)|| ||SDLK_KP_HEXADECIMAL||the Hexadecimal key (numeric keypad)|| ||SDLK_MODE||the Mode key|| ||SDLK_AUDIONEXT||the Audio Next key|| ||SDLK_AUDIOPREV||the Audio Previous key|| ||SDLK_AUDIOSTOP||the Audio Stop key|| ||SDLK_AUDIOPLAY||the Audio Play key|| ||SDLK_AUDIOMUTE||the Audio Mute key|| ||SDLK_MEDIASELECT||the Media Select key|| ||SDLK_EJECT||the Eject key|| ||SDLK_WWW||the WWW/World Wide Web key|| ||SDLK_MAIL||the Mail/eMail key|| ||SDLK_CALCULATOR||the Calculator key|| ||SDLK_COMPUTER||the My Computer key|| ||SDLK_AC_SEARCH||the Search key (application control keypad)|| ||SDLK_AC_HOME||the Home key (application control keypad)|| ||SDLK_AC_BACK||the Back key (application control keypad)|| ||SDLK_AC_FORWARD||the Forward key (application control keypad)|| ||SDLK_AC_STOP||the Stop key (application control keypad)|| ||SDLK_AC_REFRESH||the Refresh key (application control keypad)|| ||SDLK_AC_BOOKMARKS||the Bookmarks key (application control keypad)|| ||SDLK_BRIGHTNESSDOWN||the Brightness Down key|| ||SDLK_BRIGHTNESSUP||the Brightness Up key|| ||SDLK_DISPLAYSWITCH||the Display Switch key|| ||SDLK_KBDILLUMTOGGLE||the Keyboard Illumination Toggle key|| ||SDLK_KBDILLUMDOWN||the Keyboard Illumination Down key|| ||SDLK_KBDILLUMUP||the keyboard Illumination Up key|| |
<<Include(SDL_ScancodeAndKeycode, , , from="##Start include here.", to="##End include here.")>> |
| Line 250: | Line 15: |
| You can add your code example here | //checks if a key is being remapped and prints what the remapping is if(event->key.keysym.scancode != SDL_GetScancodeFromKey(event->key.keysym.sym)) printf("Physical %s key acting as %s key", SDL_GetScancodeName(event->key.keysym.scancode), SDL_GetKeyName(event->key.keysym.sym)); |
| Line 254: | Line 23: |
| ^Values of this type (also known as keycodes or keysyms) are mapped to the current layout of the keyboard and correlate to an [[SDL_scancode]]. The scancode identifies the location of a key press and the corresponding [[SDLKey]] gives that key press meaning in the context of the current keyboard layout.^ | Values of this type (also known as keycodes or keysyms) are mapped to the current layout of the keyboard and correlate to an [[SDL_Scancode]]. The scancode identifies the location of a key press and the corresponding [[SDL_Keycode]] gives that key press meaning in the context of the current keyboard layout. |
| Line 256: | Line 25: |
| ,,Values of this type are used to represent keyboard keys using the current layout of the keyboard. ,,These values include Unicode values representing the unmodified character that would be generated by pressing the key, or other constants for those keys that do not generate characters. | Values of this type are used to represent keyboard keys using the current layout of the keyboard. These values include Unicode values representing the unmodified character that would be generated by pressing the key, or other constants for those keys that do not generate characters. |
| Line 258: | Line 27: |
| <<Color2(green,Does SDL use a default layout for SDL_Key? Is it platform-specific? Are other layouts available or do they have to be created by the user/programmer? Are they automatically detected or manually set?)>> | /* Does SDL use a default layout for SDL_Keycode? Is it platform-specific? Are other layouts available or do they have to be created by the user/programmer? Are they automatically detected or manually set?)>> <<Color2(col=blue,text="These are defined in include/SDL_keysym.h and are generally set to the ASCII value associated with the key or whatever SDL_SCANCODE_TO_KEYCODE returns for that key which is the SDL_Scancode with the 30th bit set.">> */ To look up a scancode or keycode by decimal or hexadecimal value you can use the following tables: .[[SDLScancodeLookup|SDL Scancode Lookup Table]] .[[SDLKeycodeLookup|SDL Keycode Lookup Table]] |
| Line 261: | Line 34: |
| .[[SDL_scancode]] | .[[SDL_Scancode]] |
DRAFT |
SDL_Keycode
The SDL virtual key representation.
Values
Key Name |
SDL_Scancode Value |
SDL_Keycode Value |
"0" |
SDL_SCANCODE_0 |
SDLK_0 |
"1" |
SDL_SCANCODE_1 |
SDLK_1 |
"2" |
SDL_SCANCODE_2 |
SDLK_2 |
"3" |
SDL_SCANCODE_3 |
SDLK_3 |
"4" |
SDL_SCANCODE_4 |
SDLK_4 |
"5" |
SDL_SCANCODE_5 |
SDLK_5 |
"6" |
SDL_SCANCODE_6 |
SDLK_6 |
"7" |
SDL_SCANCODE_7 |
SDLK_7 |
"8" |
SDL_SCANCODE_8 |
SDLK_8 |
"9" |
SDL_SCANCODE_9 |
SDLK_9 |
"A" |
SDL_SCANCODE_A |
SDLK_a |
"AC Back" (the Back key (application control keypad)) |
SDL_SCANCODE_AC_BACK |
SDLK_AC_BACK |
"AC Bookmarks" (the Bookmarks key (application control keypad)) |
SDL_SCANCODE_AC_BOOKMARKS |
SDLK_AC_BOOKMARKS |
"AC Forward" (the Forward key (application control keypad)) |
SDL_SCANCODE_AC_FORWARD |
SDLK_AC_FORWARD |
"AC Home" (the Home key (application control keypad)) |
SDL_SCANCODE_AC_HOME |
SDLK_AC_HOME |
"AC Refresh" (the Refresh key (application control keypad)) |
SDL_SCANCODE_AC_REFRESH |
SDLK_AC_REFRESH |
"AC Search" (the Search key (application control keypad)) |
SDL_SCANCODE_AC_SEARCH |
SDLK_AC_SEARCH |
"AC Stop" (the Stop key (application control keypad)) |
SDL_SCANCODE_AC_STOP |
SDLK_AC_STOP |
"Again" (the Again key (Redo)) |
SDL_SCANCODE_AGAIN |
SDLK_AGAIN |
"AltErase" (Erase-Eaze) |
SDL_SCANCODE_ALTERASE |
SDLK_ALTERASE |
"'" |
SDL_SCANCODE_APOSTROPHE |
SDLK_QUOTE |
"Application" (the Application / Compose / Context Menu (Windows) key) |
SDL_SCANCODE_APPLICATION |
SDLK_APPLICATION |
"AudioMute" (the Mute volume key) |
SDL_SCANCODE_AUDIOMUTE |
SDLK_AUDIOMUTE |
"AudioNext" (the Next Track media key) |
SDL_SCANCODE_AUDIONEXT |
SDLK_AUDIONEXT |
"AudioPlay" (the Play media key) |
SDL_SCANCODE_AUDIOPLAY |
SDLK_AUDIOPLAY |
"AudioPrev" (the Previous Track media key) |
SDL_SCANCODE_AUDIOPREV |
SDLK_AUDIOPREV |
"AudioStop" (the Stop media key) |
SDL_SCANCODE_AUDIOSTOP |
SDLK_AUDIOSTOP |
"B" |
SDL_SCANCODE_B |
SDLK_b |
"\" (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.) |
SDL_SCANCODE_BACKSLASH |
SDLK_BACKSLASH |
"Backspace" |
SDL_SCANCODE_BACKSPACE |
SDLK_BACKSPACE |
"BrightnessDown" (the Brightness Down key) |
SDL_SCANCODE_BRIGHTNESSDOWN |
SDLK_BRIGHTNESSDOWN |
"BrightnessUp" (the Brightness Up key) |
SDL_SCANCODE_BRIGHTNESSUP |
SDLK_BRIGHTNESSUP |
"C" |
SDL_SCANCODE_C |
SDLK_c |
"Calculator" (the Calculator key) |
SDL_SCANCODE_CALCULATOR |
SDLK_CALCULATOR |
"Cancel" |
SDL_SCANCODE_CANCEL |
SDLK_CANCEL |
"CapsLock" |
SDL_SCANCODE_CAPSLOCK |
SDLK_CAPSLOCK |
"Clear" |
SDL_SCANCODE_CLEAR |
SDLK_CLEAR |
"Clear / Again" |
SDL_SCANCODE_CLEARAGAIN |
SDLK_CLEARAGAIN |
"," |
SDL_SCANCODE_COMMA |
SDLK_COMMA |
"Computer" (the My Computer key) |
SDL_SCANCODE_COMPUTER |
SDLK_COMPUTER |
"Copy" |
SDL_SCANCODE_COPY |
SDLK_COPY |
"CrSel" |
SDL_SCANCODE_CRSEL |
SDLK_CRSEL |
"CurrencySubUnit" (the Currency Subunit key) |
SDL_SCANCODE_CURRENCYSUBUNIT |
SDLK_CURRENCYSUBUNIT |
"CurrencyUnit" (the Currency Unit key) |
SDL_SCANCODE_CURRENCYUNIT |
SDLK_CURRENCYUNIT |
"Cut" |
SDL_SCANCODE_CUT |
SDLK_CUT |
"D" |
SDL_SCANCODE_D |
SDLK_d |
"DecimalSeparator" (the Decimal Separator key) |
SDL_SCANCODE_DECIMALSEPARATOR |
SDLK_DECIMALSEPARATOR |
"Delete" |
SDL_SCANCODE_DELETE |
SDLK_DELETE |
"DisplaySwitch" (display mirroring/dual display switch, video mode switch) |
SDL_SCANCODE_DISPLAYSWITCH |
SDLK_DISPLAYSWITCH |
"Down" (the Down arrow key (navigation keypad)) |
SDL_SCANCODE_DOWN |
SDLK_DOWN |
"E" |
SDL_SCANCODE_E |
SDLK_e |
"Eject" (the Eject key) |
SDL_SCANCODE_EJECT |
SDLK_EJECT |
"End" |
SDL_SCANCODE_END |
SDLK_END |
"=" |
SDL_SCANCODE_EQUALS |
SDLK_EQUALS |
"Escape" (the Esc key) |
SDL_SCANCODE_ESCAPE |
SDLK_ESCAPE |
"Execute" |
SDL_SCANCODE_EXECUTE |
SDLK_EXECUTE |
"ExSel" |
SDL_SCANCODE_EXSEL |
SDLK_EXSEL |
"F" |
SDL_SCANCODE_F |
SDLK_f |
"F1" |
SDL_SCANCODE_F1 |
SDLK_F1 |
"F10" |
SDL_SCANCODE_F10 |
SDLK_F10 |
"F11" |
SDL_SCANCODE_F11 |
SDLK_F11 |
"F12" |
SDL_SCANCODE_F12 |
SDLK_F12 |
"F13" |
SDL_SCANCODE_F13 |
SDLK_F13 |
"F14" |
SDL_SCANCODE_F14 |
SDLK_F14 |
"F15" |
SDL_SCANCODE_F15 |
SDLK_F15 |
"F16" |
SDL_SCANCODE_F16 |
SDLK_F16 |
"F17" |
SDL_SCANCODE_F17 |
SDLK_F17 |
"F18" |
SDL_SCANCODE_F18 |
SDLK_F18 |
"F19" |
SDL_SCANCODE_F19 |
SDLK_F19 |
"F2" |
SDL_SCANCODE_F2 |
SDLK_F2 |
"F20" |
SDL_SCANCODE_F20 |
SDLK_F20 |
"F21" |
SDL_SCANCODE_F21 |
SDLK_F21 |
"F22" |
SDL_SCANCODE_F22 |
SDLK_F22 |
"F23" |
SDL_SCANCODE_F23 |
SDLK_F23 |
"F24" |
SDL_SCANCODE_F24 |
SDLK_F24 |
"F3" |
SDL_SCANCODE_F3 |
SDLK_F3 |
"F4" |
SDL_SCANCODE_F4 |
SDLK_F4 |
"F5" |
SDL_SCANCODE_F5 |
SDLK_F5 |
"F6" |
SDL_SCANCODE_F6 |
SDLK_F6 |
"F7" |
SDL_SCANCODE_F7 |
SDLK_F7 |
"F8" |
SDL_SCANCODE_F8 |
SDLK_F8 |
"F9" |
SDL_SCANCODE_F9 |
SDLK_F9 |
"Find" |
SDL_SCANCODE_FIND |
SDLK_FIND |
"G" |
SDL_SCANCODE_G |
SDLK_g |
"`" (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.) |
SDL_SCANCODE_POWER |
SDLK_POWER |
"PrintScreen" |
SDL_SCANCODE_PRINTSCREEN |
SDLK_PRINTSCREEN |
"Prior" |
SDL_SCANCODE_PRIOR |
SDLK_PRIOR |
"Q" |
SDL_SCANCODE_Q |
SDLK_q |
"R" |
SDL_SCANCODE_R |
SDLK_r |
"Right Alt" (alt gr, option) |
SDL_SCANCODE_RALT |
SDLK_RALT |
"Right Ctrl" |
SDL_SCANCODE_RCTRL |
SDLK_RCTRL |
"Return" (the Enter key (main keyboard)) |
SDL_SCANCODE_RETURN |
SDLK_RETURN |
"Return" |
SDL_SCANCODE_RETURN2 |
SDLK_RETURN2 |
"Right GUI" (windows, command (apple), meta) |
SDL_SCANCODE_RGUI |
SDLK_RGUI |
"Right" (the Right arrow key (navigation keypad)) |
SDL_SCANCODE_RIGHT |
SDLK_RIGHT |
"]" |
SDL_SCANCODE_RIGHTBRACKET |
SDLK_RIGHTBRACKET |
"Right Shift" |
SDL_SCANCODE_RSHIFT |
SDLK_RSHIFT |
"S" |
SDL_SCANCODE_S |
SDLK_s |
"ScrollLock" |
SDL_SCANCODE_SCROLLLOCK |
SDLK_SCROLLLOCK |
"Select" |
SDL_SCANCODE_SELECT |
SDLK_SELECT |
";" |
SDL_SCANCODE_SEMICOLON |
SDLK_SEMICOLON |
"Separator" |
SDL_SCANCODE_SEPARATOR |
SDLK_SEPARATOR |
"/" |
SDL_SCANCODE_SLASH |
SDLK_SLASH |
"Sleep" (the Sleep key) |
SDL_SCANCODE_SLEEP |
SDLK_SLEEP |
"Space" (the Space Bar key(s)) |
SDL_SCANCODE_SPACE |
SDLK_SPACE |
"Stop" |
SDL_SCANCODE_STOP |
SDLK_STOP |
"SysReq" (the SysReq key) |
SDL_SCANCODE_SYSREQ |
SDLK_SYSREQ |
"T" |
SDL_SCANCODE_T |
SDLK_t |
"Tab" (the Tab key) |
SDL_SCANCODE_TAB |
SDLK_TAB |
"ThousandsSeparator" (the Thousands Separator key) |
SDL_SCANCODE_THOUSANDSSEPARATOR |
SDLK_THOUSANDSSEPARATOR |
"U" |
SDL_SCANCODE_U |
SDLK_u |
"Undo" |
SDL_SCANCODE_UNDO |
SDLK_UNDO |
"" (no name, empty string) |
SDL_SCANCODE_UNKNOWN |
SDLK_UNKNOWN |
"Up" (the Up arrow key (navigation keypad)) |
SDL_SCANCODE_UP |
SDLK_UP |
"V" |
SDL_SCANCODE_V |
SDLK_v |
"VolumeDown" |
SDL_SCANCODE_VOLUMEDOWN |
SDLK_VOLUMEDOWN |
"VolumeUp" |
SDL_SCANCODE_VOLUMEUP |
SDLK_VOLUMEUP |
"W" |
SDL_SCANCODE_W |
SDLK_w |
"WWW" (the WWW/World Wide Web key) |
SDL_SCANCODE_WWW |
SDLK_WWW |
"X" |
SDL_SCANCODE_X |
SDLK_x |
"Y" |
SDL_SCANCODE_Y |
SDLK_y |
"Z" |
SDL_SCANCODE_Z |
SDLK_z |
These physical keys do not have corresponding virtual key values |
||
"" (no name, empty string; used on Asian keyboards, see footnotes in USB doc) |
SDL_SCANCODE_INTERNATIONAL1 |
(none) |
"" (no name, empty string) |
SDL_SCANCODE_INTERNATIONAL2 |
(none) |
"" (no name, empty string; Yen) |
SDL_SCANCODE_INTERNATIONAL3 |
(none) |
"" (no name, empty string) |
SDL_SCANCODE_INTERNATIONAL4 |
(none) |
"" (no name, empty string) |
SDL_SCANCODE_INTERNATIONAL5 |
(none) |
"" (no name, empty string) |
SDL_SCANCODE_INTERNATIONAL6 |
(none) |
"" (no name, empty string) |
SDL_SCANCODE_INTERNATIONAL7 |
(none) |
"" (no name, empty string) |
SDL_SCANCODE_INTERNATIONAL8 |
(none) |
"" (no name, empty string) |
SDL_SCANCODE_INTERNATIONAL9 |
(none) |
"" (no name, empty string; Hangul/English toggle) |
SDL_SCANCODE_LANG1 |
(none) |
"" (no name, empty string; Hanja conversion) |
SDL_SCANCODE_LANG2 |
(none) |
"" (no name, empty string; Katakana) |
SDL_SCANCODE_LANG3 |
(none) |
"" (no name, empty string; Hiragana) |
SDL_SCANCODE_LANG4 |
(none) |
"" (no name, empty string; Zenkaku/Hankaku) |
SDL_SCANCODE_LANG5 |
(none) |
"" (no name, empty string; reserved) |
SDL_SCANCODE_LANG6 |
(none) |
"" (no name, empty string; reserved) |
SDL_SCANCODE_LANG7 |
(none) |
"" (no name, empty string; reserved) |
SDL_SCANCODE_LANG8 |
(none) |
"" (no name, empty string; reserved) |
SDL_SCANCODE_LANG9 |
(none) |
"" (no name, empty string) |
SDL_SCANCODE_LOCKINGCAPSLOCK |
(none) |
"" (no name, empty string) |
SDL_SCANCODE_LOCKINGNUMLOCK |
(none) |
"" (no name, empty string) |
SDL_SCANCODE_LOCKINGSCROLLLOCK |
(none) |
"" (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))
printf("Physical %s key acting as %s key",
SDL_GetScancodeName(event->key.keysym.scancode),
SDL_GetKeyName(event->key.keysym.sym));
Remarks
Values of this type (also known as keycodes or keysyms) are mapped to the current layout of the keyboard and correlate to an SDL_Scancode. The scancode identifies the location of a key press and the corresponding SDL_Keycode gives that key press meaning in the context of the current keyboard layout.
Values of this type are used to represent keyboard keys using the current layout of the keyboard. These values include Unicode values representing the unmodified character that would be generated by pressing the key, or other constants for those keys that do not generate characters.
To look up a scancode or keycode by decimal or hexadecimal value you can use the following tables:
Related Enumerations
