SDL standard library
Embed:
(wiki syntax)
Show/hide line numbers
SDL_scancode.h
Go to the documentation of this file.
00001 /* 00002 Simple DirectMedia Layer 00003 Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org> 00004 00005 This software is provided 'as-is', without any express or implied 00006 warranty. In no event will the authors be held liable for any damages 00007 arising from the use of this software. 00008 00009 Permission is granted to anyone to use this software for any purpose, 00010 including commercial applications, and to alter it and redistribute it 00011 freely, subject to the following restrictions: 00012 00013 1. The origin of this software must not be misrepresented; you must not 00014 claim that you wrote the original software. If you use this software 00015 in a product, an acknowledgment in the product documentation would be 00016 appreciated but is not required. 00017 2. Altered source versions must be plainly marked as such, and must not be 00018 misrepresented as being the original software. 00019 3. This notice may not be removed or altered from any source distribution. 00020 */ 00021 00022 /** 00023 * \file SDL_scancode.h 00024 * 00025 * Defines keyboard scancodes. 00026 */ 00027 00028 #ifndef _SDL_scancode_h 00029 #define _SDL_scancode_h 00030 00031 #include "SDL_stdinc.h" 00032 00033 /** 00034 * \brief The SDL keyboard scancode representation. 00035 * 00036 * Values of this type are used to represent keyboard keys, among other places 00037 * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the 00038 * SDL_Event structure. 00039 * 00040 * The values in this enumeration are based on the USB usage page standard: 00041 * http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdf 00042 */ 00043 typedef enum 00044 { 00045 SDL_SCANCODE_UNKNOWN = 0, 00046 00047 /** 00048 * \name Usage page 0x07 00049 * 00050 * These values are from usage page 0x07 (USB keyboard page). 00051 */ 00052 /* @{ */ 00053 00054 SDL_SCANCODE_A = 4, 00055 SDL_SCANCODE_B = 5, 00056 SDL_SCANCODE_C = 6, 00057 SDL_SCANCODE_D = 7, 00058 SDL_SCANCODE_E = 8, 00059 SDL_SCANCODE_F = 9, 00060 SDL_SCANCODE_G = 10, 00061 SDL_SCANCODE_H = 11, 00062 SDL_SCANCODE_I = 12, 00063 SDL_SCANCODE_J = 13, 00064 SDL_SCANCODE_K = 14, 00065 SDL_SCANCODE_L = 15, 00066 SDL_SCANCODE_M = 16, 00067 SDL_SCANCODE_N = 17, 00068 SDL_SCANCODE_O = 18, 00069 SDL_SCANCODE_P = 19, 00070 SDL_SCANCODE_Q = 20, 00071 SDL_SCANCODE_R = 21, 00072 SDL_SCANCODE_S = 22, 00073 SDL_SCANCODE_T = 23, 00074 SDL_SCANCODE_U = 24, 00075 SDL_SCANCODE_V = 25, 00076 SDL_SCANCODE_W = 26, 00077 SDL_SCANCODE_X = 27, 00078 SDL_SCANCODE_Y = 28, 00079 SDL_SCANCODE_Z = 29, 00080 00081 SDL_SCANCODE_1 = 30, 00082 SDL_SCANCODE_2 = 31, 00083 SDL_SCANCODE_3 = 32, 00084 SDL_SCANCODE_4 = 33, 00085 SDL_SCANCODE_5 = 34, 00086 SDL_SCANCODE_6 = 35, 00087 SDL_SCANCODE_7 = 36, 00088 SDL_SCANCODE_8 = 37, 00089 SDL_SCANCODE_9 = 38, 00090 SDL_SCANCODE_0 = 39, 00091 00092 SDL_SCANCODE_RETURN = 40, 00093 SDL_SCANCODE_ESCAPE = 41, 00094 SDL_SCANCODE_BACKSPACE = 42, 00095 SDL_SCANCODE_TAB = 43, 00096 SDL_SCANCODE_SPACE = 44, 00097 00098 SDL_SCANCODE_MINUS = 45, 00099 SDL_SCANCODE_EQUALS = 46, 00100 SDL_SCANCODE_LEFTBRACKET = 47, 00101 SDL_SCANCODE_RIGHTBRACKET = 48, 00102 SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return 00103 * key on ISO keyboards and at the right end 00104 * of the QWERTY row on ANSI keyboards. 00105 * Produces REVERSE SOLIDUS (backslash) and 00106 * VERTICAL LINE in a US layout, REVERSE 00107 * SOLIDUS and VERTICAL LINE in a UK Mac 00108 * layout, NUMBER SIGN and TILDE in a UK 00109 * Windows layout, DOLLAR SIGN and POUND SIGN 00110 * in a Swiss German layout, NUMBER SIGN and 00111 * APOSTROPHE in a German layout, GRAVE 00112 * ACCENT and POUND SIGN in a French Mac 00113 * layout, and ASTERISK and MICRO SIGN in a 00114 * French Windows layout. 00115 */ 00116 SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code 00117 * instead of 49 for the same key, but all 00118 * OSes I've seen treat the two codes 00119 * identically. So, as an implementor, unless 00120 * your keyboard generates both of those 00121 * codes and your OS treats them differently, 00122 * you should generate SDL_SCANCODE_BACKSLASH 00123 * instead of this code. As a user, you 00124 * should not rely on this code because SDL 00125 * will never generate it with most (all?) 00126 * keyboards. 00127 */ 00128 SDL_SCANCODE_SEMICOLON = 51, 00129 SDL_SCANCODE_APOSTROPHE = 52, 00130 SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI 00131 * and ISO keyboards). Produces GRAVE ACCENT and 00132 * TILDE in a US Windows layout and in US and UK 00133 * Mac layouts on ANSI keyboards, GRAVE ACCENT 00134 * and NOT SIGN in a UK Windows layout, SECTION 00135 * SIGN and PLUS-MINUS SIGN in US and UK Mac 00136 * layouts on ISO keyboards, SECTION SIGN and 00137 * DEGREE SIGN in a Swiss German layout (Mac: 00138 * only on ISO keyboards), CIRCUMFLEX ACCENT and 00139 * DEGREE SIGN in a German layout (Mac: only on 00140 * ISO keyboards), SUPERSCRIPT TWO and TILDE in a 00141 * French Windows layout, COMMERCIAL AT and 00142 * NUMBER SIGN in a French Mac layout on ISO 00143 * keyboards, and LESS-THAN SIGN and GREATER-THAN 00144 * SIGN in a Swiss German, German, or French Mac 00145 * layout on ANSI keyboards. 00146 */ 00147 SDL_SCANCODE_COMMA = 54, 00148 SDL_SCANCODE_PERIOD = 55, 00149 SDL_SCANCODE_SLASH = 56, 00150 00151 SDL_SCANCODE_CAPSLOCK = 57, 00152 00153 SDL_SCANCODE_F1 = 58, 00154 SDL_SCANCODE_F2 = 59, 00155 SDL_SCANCODE_F3 = 60, 00156 SDL_SCANCODE_F4 = 61, 00157 SDL_SCANCODE_F5 = 62, 00158 SDL_SCANCODE_F6 = 63, 00159 SDL_SCANCODE_F7 = 64, 00160 SDL_SCANCODE_F8 = 65, 00161 SDL_SCANCODE_F9 = 66, 00162 SDL_SCANCODE_F10 = 67, 00163 SDL_SCANCODE_F11 = 68, 00164 SDL_SCANCODE_F12 = 69, 00165 00166 SDL_SCANCODE_PRINTSCREEN = 70, 00167 SDL_SCANCODE_SCROLLLOCK = 71, 00168 SDL_SCANCODE_PAUSE = 72, 00169 SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but 00170 does send code 73, not 117) */ 00171 SDL_SCANCODE_HOME = 74, 00172 SDL_SCANCODE_PAGEUP = 75, 00173 SDL_SCANCODE_DELETE = 76, 00174 SDL_SCANCODE_END = 77, 00175 SDL_SCANCODE_PAGEDOWN = 78, 00176 SDL_SCANCODE_RIGHT = 79, 00177 SDL_SCANCODE_LEFT = 80, 00178 SDL_SCANCODE_DOWN = 81, 00179 SDL_SCANCODE_UP = 82, 00180 00181 SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards 00182 */ 00183 SDL_SCANCODE_KP_DIVIDE = 84, 00184 SDL_SCANCODE_KP_MULTIPLY = 85, 00185 SDL_SCANCODE_KP_MINUS = 86, 00186 SDL_SCANCODE_KP_PLUS = 87, 00187 SDL_SCANCODE_KP_ENTER = 88, 00188 SDL_SCANCODE_KP_1 = 89, 00189 SDL_SCANCODE_KP_2 = 90, 00190 SDL_SCANCODE_KP_3 = 91, 00191 SDL_SCANCODE_KP_4 = 92, 00192 SDL_SCANCODE_KP_5 = 93, 00193 SDL_SCANCODE_KP_6 = 94, 00194 SDL_SCANCODE_KP_7 = 95, 00195 SDL_SCANCODE_KP_8 = 96, 00196 SDL_SCANCODE_KP_9 = 97, 00197 SDL_SCANCODE_KP_0 = 98, 00198 SDL_SCANCODE_KP_PERIOD = 99, 00199 00200 SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO 00201 * keyboards have over ANSI ones, 00202 * located between left shift and Y. 00203 * Produces GRAVE ACCENT and TILDE in a 00204 * US or UK Mac layout, REVERSE SOLIDUS 00205 * (backslash) and VERTICAL LINE in a 00206 * US or UK Windows layout, and 00207 * LESS-THAN SIGN and GREATER-THAN SIGN 00208 * in a Swiss German, German, or French 00209 * layout. */ 00210 SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ 00211 SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, 00212 * not a physical key - but some Mac keyboards 00213 * do have a power key. */ 00214 SDL_SCANCODE_KP_EQUALS = 103, 00215 SDL_SCANCODE_F13 = 104, 00216 SDL_SCANCODE_F14 = 105, 00217 SDL_SCANCODE_F15 = 106, 00218 SDL_SCANCODE_F16 = 107, 00219 SDL_SCANCODE_F17 = 108, 00220 SDL_SCANCODE_F18 = 109, 00221 SDL_SCANCODE_F19 = 110, 00222 SDL_SCANCODE_F20 = 111, 00223 SDL_SCANCODE_F21 = 112, 00224 SDL_SCANCODE_F22 = 113, 00225 SDL_SCANCODE_F23 = 114, 00226 SDL_SCANCODE_F24 = 115, 00227 SDL_SCANCODE_EXECUTE = 116, 00228 SDL_SCANCODE_HELP = 117, 00229 SDL_SCANCODE_MENU = 118, 00230 SDL_SCANCODE_SELECT = 119, 00231 SDL_SCANCODE_STOP = 120, 00232 SDL_SCANCODE_AGAIN = 121, /**< redo */ 00233 SDL_SCANCODE_UNDO = 122, 00234 SDL_SCANCODE_CUT = 123, 00235 SDL_SCANCODE_COPY = 124, 00236 SDL_SCANCODE_PASTE = 125, 00237 SDL_SCANCODE_FIND = 126, 00238 SDL_SCANCODE_MUTE = 127, 00239 SDL_SCANCODE_VOLUMEUP = 128, 00240 SDL_SCANCODE_VOLUMEDOWN = 129, 00241 /* not sure whether there's a reason to enable these */ 00242 /* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */ 00243 /* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */ 00244 /* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */ 00245 SDL_SCANCODE_KP_COMMA = 133, 00246 SDL_SCANCODE_KP_EQUALSAS400 = 134, 00247 00248 SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see 00249 footnotes in USB doc */ 00250 SDL_SCANCODE_INTERNATIONAL2 = 136, 00251 SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ 00252 SDL_SCANCODE_INTERNATIONAL4 = 138, 00253 SDL_SCANCODE_INTERNATIONAL5 = 139, 00254 SDL_SCANCODE_INTERNATIONAL6 = 140, 00255 SDL_SCANCODE_INTERNATIONAL7 = 141, 00256 SDL_SCANCODE_INTERNATIONAL8 = 142, 00257 SDL_SCANCODE_INTERNATIONAL9 = 143, 00258 SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */ 00259 SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */ 00260 SDL_SCANCODE_LANG3 = 146, /**< Katakana */ 00261 SDL_SCANCODE_LANG4 = 147, /**< Hiragana */ 00262 SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */ 00263 SDL_SCANCODE_LANG6 = 149, /**< reserved */ 00264 SDL_SCANCODE_LANG7 = 150, /**< reserved */ 00265 SDL_SCANCODE_LANG8 = 151, /**< reserved */ 00266 SDL_SCANCODE_LANG9 = 152, /**< reserved */ 00267 00268 SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */ 00269 SDL_SCANCODE_SYSREQ = 154, 00270 SDL_SCANCODE_CANCEL = 155, 00271 SDL_SCANCODE_CLEAR = 156, 00272 SDL_SCANCODE_PRIOR = 157, 00273 SDL_SCANCODE_RETURN2 = 158, 00274 SDL_SCANCODE_SEPARATOR = 159, 00275 SDL_SCANCODE_OUT = 160, 00276 SDL_SCANCODE_OPER = 161, 00277 SDL_SCANCODE_CLEARAGAIN = 162, 00278 SDL_SCANCODE_CRSEL = 163, 00279 SDL_SCANCODE_EXSEL = 164, 00280 00281 SDL_SCANCODE_KP_00 = 176, 00282 SDL_SCANCODE_KP_000 = 177, 00283 SDL_SCANCODE_THOUSANDSSEPARATOR = 178, 00284 SDL_SCANCODE_DECIMALSEPARATOR = 179, 00285 SDL_SCANCODE_CURRENCYUNIT = 180, 00286 SDL_SCANCODE_CURRENCYSUBUNIT = 181, 00287 SDL_SCANCODE_KP_LEFTPAREN = 182, 00288 SDL_SCANCODE_KP_RIGHTPAREN = 183, 00289 SDL_SCANCODE_KP_LEFTBRACE = 184, 00290 SDL_SCANCODE_KP_RIGHTBRACE = 185, 00291 SDL_SCANCODE_KP_TAB = 186, 00292 SDL_SCANCODE_KP_BACKSPACE = 187, 00293 SDL_SCANCODE_KP_A = 188, 00294 SDL_SCANCODE_KP_B = 189, 00295 SDL_SCANCODE_KP_C = 190, 00296 SDL_SCANCODE_KP_D = 191, 00297 SDL_SCANCODE_KP_E = 192, 00298 SDL_SCANCODE_KP_F = 193, 00299 SDL_SCANCODE_KP_XOR = 194, 00300 SDL_SCANCODE_KP_POWER = 195, 00301 SDL_SCANCODE_KP_PERCENT = 196, 00302 SDL_SCANCODE_KP_LESS = 197, 00303 SDL_SCANCODE_KP_GREATER = 198, 00304 SDL_SCANCODE_KP_AMPERSAND = 199, 00305 SDL_SCANCODE_KP_DBLAMPERSAND = 200, 00306 SDL_SCANCODE_KP_VERTICALBAR = 201, 00307 SDL_SCANCODE_KP_DBLVERTICALBAR = 202, 00308 SDL_SCANCODE_KP_COLON = 203, 00309 SDL_SCANCODE_KP_HASH = 204, 00310 SDL_SCANCODE_KP_SPACE = 205, 00311 SDL_SCANCODE_KP_AT = 206, 00312 SDL_SCANCODE_KP_EXCLAM = 207, 00313 SDL_SCANCODE_KP_MEMSTORE = 208, 00314 SDL_SCANCODE_KP_MEMRECALL = 209, 00315 SDL_SCANCODE_KP_MEMCLEAR = 210, 00316 SDL_SCANCODE_KP_MEMADD = 211, 00317 SDL_SCANCODE_KP_MEMSUBTRACT = 212, 00318 SDL_SCANCODE_KP_MEMMULTIPLY = 213, 00319 SDL_SCANCODE_KP_MEMDIVIDE = 214, 00320 SDL_SCANCODE_KP_PLUSMINUS = 215, 00321 SDL_SCANCODE_KP_CLEAR = 216, 00322 SDL_SCANCODE_KP_CLEARENTRY = 217, 00323 SDL_SCANCODE_KP_BINARY = 218, 00324 SDL_SCANCODE_KP_OCTAL = 219, 00325 SDL_SCANCODE_KP_DECIMAL = 220, 00326 SDL_SCANCODE_KP_HEXADECIMAL = 221, 00327 00328 SDL_SCANCODE_LCTRL = 224, 00329 SDL_SCANCODE_LSHIFT = 225, 00330 SDL_SCANCODE_LALT = 226, /**< alt, option */ 00331 SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */ 00332 SDL_SCANCODE_RCTRL = 228, 00333 SDL_SCANCODE_RSHIFT = 229, 00334 SDL_SCANCODE_RALT = 230, /**< alt gr, option */ 00335 SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ 00336 00337 SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered 00338 * by any of the above, but since there's a 00339 * special KMOD_MODE for it I'm adding it here 00340 */ 00341 00342 /* @} *//* Usage page 0x07 */ 00343 00344 /** 00345 * \name Usage page 0x0C 00346 * 00347 * These values are mapped from usage page 0x0C (USB consumer page). 00348 */ 00349 /* @{ */ 00350 00351 SDL_SCANCODE_AUDIONEXT = 258, 00352 SDL_SCANCODE_AUDIOPREV = 259, 00353 SDL_SCANCODE_AUDIOSTOP = 260, 00354 SDL_SCANCODE_AUDIOPLAY = 261, 00355 SDL_SCANCODE_AUDIOMUTE = 262, 00356 SDL_SCANCODE_MEDIASELECT = 263, 00357 SDL_SCANCODE_WWW = 264, 00358 SDL_SCANCODE_MAIL = 265, 00359 SDL_SCANCODE_CALCULATOR = 266, 00360 SDL_SCANCODE_COMPUTER = 267, 00361 SDL_SCANCODE_AC_SEARCH = 268, 00362 SDL_SCANCODE_AC_HOME = 269, 00363 SDL_SCANCODE_AC_BACK = 270, 00364 SDL_SCANCODE_AC_FORWARD = 271, 00365 SDL_SCANCODE_AC_STOP = 272, 00366 SDL_SCANCODE_AC_REFRESH = 273, 00367 SDL_SCANCODE_AC_BOOKMARKS = 274, 00368 00369 /* @} *//* Usage page 0x0C */ 00370 00371 /** 00372 * \name Walther keys 00373 * 00374 * These are values that Christian Walther added (for mac keyboard?). 00375 */ 00376 /* @{ */ 00377 00378 SDL_SCANCODE_BRIGHTNESSDOWN = 275, 00379 SDL_SCANCODE_BRIGHTNESSUP = 276, 00380 SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display 00381 switch, video mode switch */ 00382 SDL_SCANCODE_KBDILLUMTOGGLE = 278, 00383 SDL_SCANCODE_KBDILLUMDOWN = 279, 00384 SDL_SCANCODE_KBDILLUMUP = 280, 00385 SDL_SCANCODE_EJECT = 281, 00386 SDL_SCANCODE_SLEEP = 282, 00387 00388 SDL_SCANCODE_APP1 = 283, 00389 SDL_SCANCODE_APP2 = 284, 00390 00391 /* @} *//* Walther keys */ 00392 00393 /* Add any other keys here. */ 00394 00395 SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes 00396 for array bounds */ 00397 } SDL_Scancode; 00398 00399 #endif /* _SDL_scancode_h */ 00400 00401 /* vi: set ts=4 sw=4 expandtab: */
Generated on Tue Jul 12 2022 13:56:25 by 1.7.2