Home | History | Annotate | Download | only in include
      1 /*
      2     SDL - Simple DirectMedia Layer
      3     Copyright (C) 1997-2012 Sam Lantinga
      4 
      5     This library is free software; you can redistribute it and/or
      6     modify it under the terms of the GNU Lesser General Public
      7     License as published by the Free Software Foundation; either
      8     version 2.1 of the License, or (at your option) any later version.
      9 
     10     This library is distributed in the hope that it will be useful,
     11     but WITHOUT ANY WARRANTY; without even the implied warranty of
     12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13     Lesser General Public License for more details.
     14 
     15     You should have received a copy of the GNU Lesser General Public
     16     License along with this library; if not, write to the Free Software
     17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     18 
     19     Sam Lantinga
     20     slouken (at) libsdl.org
     21 */
     22 
     23 #ifndef _SDL_keysym_h
     24 #define _SDL_keysym_h
     25 
     26 /** What we really want is a mapping of every raw key on the keyboard.
     27  *  To support international keyboards, we use the range 0xA1 - 0xFF
     28  *  as international virtual keycodes.  We'll follow in the footsteps of X11...
     29  *  @brief The names of the keys
     30  */
     31 typedef enum {
     32         /** @name ASCII mapped keysyms
     33          *  The keyboard syms have been cleverly chosen to map to ASCII
     34          */
     35         /*@{*/
     36 	SDLK_UNKNOWN		= 0,
     37 	SDLK_FIRST		= 0,
     38 	SDLK_BACKSPACE		= 8,
     39 	SDLK_TAB		= 9,
     40 	SDLK_CLEAR		= 12,
     41 	SDLK_RETURN		= 13,
     42 	SDLK_PAUSE		= 19,
     43 	SDLK_ESCAPE		= 27,
     44 	SDLK_SPACE		= 32,
     45 	SDLK_EXCLAIM		= 33,
     46 	SDLK_QUOTEDBL		= 34,
     47 	SDLK_HASH		= 35,
     48 	SDLK_DOLLAR		= 36,
     49 	SDLK_AMPERSAND		= 38,
     50 	SDLK_QUOTE		= 39,
     51 	SDLK_LEFTPAREN		= 40,
     52 	SDLK_RIGHTPAREN		= 41,
     53 	SDLK_ASTERISK		= 42,
     54 	SDLK_PLUS		= 43,
     55 	SDLK_COMMA		= 44,
     56 	SDLK_MINUS		= 45,
     57 	SDLK_PERIOD		= 46,
     58 	SDLK_SLASH		= 47,
     59 	SDLK_0			= 48,
     60 	SDLK_1			= 49,
     61 	SDLK_2			= 50,
     62 	SDLK_3			= 51,
     63 	SDLK_4			= 52,
     64 	SDLK_5			= 53,
     65 	SDLK_6			= 54,
     66 	SDLK_7			= 55,
     67 	SDLK_8			= 56,
     68 	SDLK_9			= 57,
     69 	SDLK_COLON		= 58,
     70 	SDLK_SEMICOLON		= 59,
     71 	SDLK_LESS		= 60,
     72 	SDLK_EQUALS		= 61,
     73 	SDLK_GREATER		= 62,
     74 	SDLK_QUESTION		= 63,
     75 	SDLK_AT			= 64,
     76 	/*
     77 	   Skip uppercase letters
     78 	 */
     79 	SDLK_LEFTBRACKET	= 91,
     80 	SDLK_BACKSLASH		= 92,
     81 	SDLK_RIGHTBRACKET	= 93,
     82 	SDLK_CARET		= 94,
     83 	SDLK_UNDERSCORE		= 95,
     84 	SDLK_BACKQUOTE		= 96,
     85 	SDLK_a			= 97,
     86 	SDLK_b			= 98,
     87 	SDLK_c			= 99,
     88 	SDLK_d			= 100,
     89 	SDLK_e			= 101,
     90 	SDLK_f			= 102,
     91 	SDLK_g			= 103,
     92 	SDLK_h			= 104,
     93 	SDLK_i			= 105,
     94 	SDLK_j			= 106,
     95 	SDLK_k			= 107,
     96 	SDLK_l			= 108,
     97 	SDLK_m			= 109,
     98 	SDLK_n			= 110,
     99 	SDLK_o			= 111,
    100 	SDLK_p			= 112,
    101 	SDLK_q			= 113,
    102 	SDLK_r			= 114,
    103 	SDLK_s			= 115,
    104 	SDLK_t			= 116,
    105 	SDLK_u			= 117,
    106 	SDLK_v			= 118,
    107 	SDLK_w			= 119,
    108 	SDLK_x			= 120,
    109 	SDLK_y			= 121,
    110 	SDLK_z			= 122,
    111 	SDLK_DELETE		= 127,
    112 	/* End of ASCII mapped keysyms */
    113         /*@}*/
    114 
    115 	/** @name International keyboard syms */
    116         /*@{*/
    117 	SDLK_WORLD_0		= 160,		/* 0xA0 */
    118 	SDLK_WORLD_1		= 161,
    119 	SDLK_WORLD_2		= 162,
    120 	SDLK_WORLD_3		= 163,
    121 	SDLK_WORLD_4		= 164,
    122 	SDLK_WORLD_5		= 165,
    123 	SDLK_WORLD_6		= 166,
    124 	SDLK_WORLD_7		= 167,
    125 	SDLK_WORLD_8		= 168,
    126 	SDLK_WORLD_9		= 169,
    127 	SDLK_WORLD_10		= 170,
    128 	SDLK_WORLD_11		= 171,
    129 	SDLK_WORLD_12		= 172,
    130 	SDLK_WORLD_13		= 173,
    131 	SDLK_WORLD_14		= 174,
    132 	SDLK_WORLD_15		= 175,
    133 	SDLK_WORLD_16		= 176,
    134 	SDLK_WORLD_17		= 177,
    135 	SDLK_WORLD_18		= 178,
    136 	SDLK_WORLD_19		= 179,
    137 	SDLK_WORLD_20		= 180,
    138 	SDLK_WORLD_21		= 181,
    139 	SDLK_WORLD_22		= 182,
    140 	SDLK_WORLD_23		= 183,
    141 	SDLK_WORLD_24		= 184,
    142 	SDLK_WORLD_25		= 185,
    143 	SDLK_WORLD_26		= 186,
    144 	SDLK_WORLD_27		= 187,
    145 	SDLK_WORLD_28		= 188,
    146 	SDLK_WORLD_29		= 189,
    147 	SDLK_WORLD_30		= 190,
    148 	SDLK_WORLD_31		= 191,
    149 	SDLK_WORLD_32		= 192,
    150 	SDLK_WORLD_33		= 193,
    151 	SDLK_WORLD_34		= 194,
    152 	SDLK_WORLD_35		= 195,
    153 	SDLK_WORLD_36		= 196,
    154 	SDLK_WORLD_37		= 197,
    155 	SDLK_WORLD_38		= 198,
    156 	SDLK_WORLD_39		= 199,
    157 	SDLK_WORLD_40		= 200,
    158 	SDLK_WORLD_41		= 201,
    159 	SDLK_WORLD_42		= 202,
    160 	SDLK_WORLD_43		= 203,
    161 	SDLK_WORLD_44		= 204,
    162 	SDLK_WORLD_45		= 205,
    163 	SDLK_WORLD_46		= 206,
    164 	SDLK_WORLD_47		= 207,
    165 	SDLK_WORLD_48		= 208,
    166 	SDLK_WORLD_49		= 209,
    167 	SDLK_WORLD_50		= 210,
    168 	SDLK_WORLD_51		= 211,
    169 	SDLK_WORLD_52		= 212,
    170 	SDLK_WORLD_53		= 213,
    171 	SDLK_WORLD_54		= 214,
    172 	SDLK_WORLD_55		= 215,
    173 	SDLK_WORLD_56		= 216,
    174 	SDLK_WORLD_57		= 217,
    175 	SDLK_WORLD_58		= 218,
    176 	SDLK_WORLD_59		= 219,
    177 	SDLK_WORLD_60		= 220,
    178 	SDLK_WORLD_61		= 221,
    179 	SDLK_WORLD_62		= 222,
    180 	SDLK_WORLD_63		= 223,
    181 	SDLK_WORLD_64		= 224,
    182 	SDLK_WORLD_65		= 225,
    183 	SDLK_WORLD_66		= 226,
    184 	SDLK_WORLD_67		= 227,
    185 	SDLK_WORLD_68		= 228,
    186 	SDLK_WORLD_69		= 229,
    187 	SDLK_WORLD_70		= 230,
    188 	SDLK_WORLD_71		= 231,
    189 	SDLK_WORLD_72		= 232,
    190 	SDLK_WORLD_73		= 233,
    191 	SDLK_WORLD_74		= 234,
    192 	SDLK_WORLD_75		= 235,
    193 	SDLK_WORLD_76		= 236,
    194 	SDLK_WORLD_77		= 237,
    195 	SDLK_WORLD_78		= 238,
    196 	SDLK_WORLD_79		= 239,
    197 	SDLK_WORLD_80		= 240,
    198 	SDLK_WORLD_81		= 241,
    199 	SDLK_WORLD_82		= 242,
    200 	SDLK_WORLD_83		= 243,
    201 	SDLK_WORLD_84		= 244,
    202 	SDLK_WORLD_85		= 245,
    203 	SDLK_WORLD_86		= 246,
    204 	SDLK_WORLD_87		= 247,
    205 	SDLK_WORLD_88		= 248,
    206 	SDLK_WORLD_89		= 249,
    207 	SDLK_WORLD_90		= 250,
    208 	SDLK_WORLD_91		= 251,
    209 	SDLK_WORLD_92		= 252,
    210 	SDLK_WORLD_93		= 253,
    211 	SDLK_WORLD_94		= 254,
    212 	SDLK_WORLD_95		= 255,		/* 0xFF */
    213         /*@}*/
    214 
    215 	/** @name Numeric keypad */
    216         /*@{*/
    217 	SDLK_KP0		= 256,
    218 	SDLK_KP1		= 257,
    219 	SDLK_KP2		= 258,
    220 	SDLK_KP3		= 259,
    221 	SDLK_KP4		= 260,
    222 	SDLK_KP5		= 261,
    223 	SDLK_KP6		= 262,
    224 	SDLK_KP7		= 263,
    225 	SDLK_KP8		= 264,
    226 	SDLK_KP9		= 265,
    227 	SDLK_KP_PERIOD		= 266,
    228 	SDLK_KP_DIVIDE		= 267,
    229 	SDLK_KP_MULTIPLY	= 268,
    230 	SDLK_KP_MINUS		= 269,
    231 	SDLK_KP_PLUS		= 270,
    232 	SDLK_KP_ENTER		= 271,
    233 	SDLK_KP_EQUALS		= 272,
    234         /*@}*/
    235 
    236 	/** @name Arrows + Home/End pad */
    237         /*@{*/
    238 	SDLK_UP			= 273,
    239 	SDLK_DOWN		= 274,
    240 	SDLK_RIGHT		= 275,
    241 	SDLK_LEFT		= 276,
    242 	SDLK_INSERT		= 277,
    243 	SDLK_HOME		= 278,
    244 	SDLK_END		= 279,
    245 	SDLK_PAGEUP		= 280,
    246 	SDLK_PAGEDOWN		= 281,
    247         /*@}*/
    248 
    249 	/** @name Function keys */
    250         /*@{*/
    251 	SDLK_F1			= 282,
    252 	SDLK_F2			= 283,
    253 	SDLK_F3			= 284,
    254 	SDLK_F4			= 285,
    255 	SDLK_F5			= 286,
    256 	SDLK_F6			= 287,
    257 	SDLK_F7			= 288,
    258 	SDLK_F8			= 289,
    259 	SDLK_F9			= 290,
    260 	SDLK_F10		= 291,
    261 	SDLK_F11		= 292,
    262 	SDLK_F12		= 293,
    263 	SDLK_F13		= 294,
    264 	SDLK_F14		= 295,
    265 	SDLK_F15		= 296,
    266         /*@}*/
    267 
    268 	/** @name Key state modifier keys */
    269         /*@{*/
    270 	SDLK_NUMLOCK		= 300,
    271 	SDLK_CAPSLOCK		= 301,
    272 	SDLK_SCROLLOCK		= 302,
    273 	SDLK_RSHIFT		= 303,
    274 	SDLK_LSHIFT		= 304,
    275 	SDLK_RCTRL		= 305,
    276 	SDLK_LCTRL		= 306,
    277 	SDLK_RALT		= 307,
    278 	SDLK_LALT		= 308,
    279 	SDLK_RMETA		= 309,
    280 	SDLK_LMETA		= 310,
    281 	SDLK_LSUPER		= 311,		/**< Left "Windows" key */
    282 	SDLK_RSUPER		= 312,		/**< Right "Windows" key */
    283 	SDLK_MODE		= 313,		/**< "Alt Gr" key */
    284 	SDLK_COMPOSE		= 314,		/**< Multi-key compose key */
    285         /*@}*/
    286 
    287 	/** @name Miscellaneous function keys */
    288         /*@{*/
    289 	SDLK_HELP		= 315,
    290 	SDLK_PRINT		= 316,
    291 	SDLK_SYSREQ		= 317,
    292 	SDLK_BREAK		= 318,
    293 	SDLK_MENU		= 319,
    294 	SDLK_POWER		= 320,		/**< Power Macintosh power key */
    295 	SDLK_EURO		= 321,		/**< Some european keyboards */
    296 	SDLK_UNDO		= 322,		/**< Atari keyboard has Undo */
    297         /*@}*/
    298 
    299 	/* Add any other keys here */
    300 
    301 	SDLK_LAST
    302 } SDLKey;
    303 
    304 /** Enumeration of valid key mods (possibly OR'd together) */
    305 typedef enum {
    306 	KMOD_NONE  = 0x0000,
    307 	KMOD_LSHIFT= 0x0001,
    308 	KMOD_RSHIFT= 0x0002,
    309 	KMOD_LCTRL = 0x0040,
    310 	KMOD_RCTRL = 0x0080,
    311 	KMOD_LALT  = 0x0100,
    312 	KMOD_RALT  = 0x0200,
    313 	KMOD_LMETA = 0x0400,
    314 	KMOD_RMETA = 0x0800,
    315 	KMOD_NUM   = 0x1000,
    316 	KMOD_CAPS  = 0x2000,
    317 	KMOD_MODE  = 0x4000,
    318 	KMOD_RESERVED = 0x8000
    319 } SDLMod;
    320 
    321 #define KMOD_CTRL	(KMOD_LCTRL|KMOD_RCTRL)
    322 #define KMOD_SHIFT	(KMOD_LSHIFT|KMOD_RSHIFT)
    323 #define KMOD_ALT	(KMOD_LALT|KMOD_RALT)
    324 #define KMOD_META	(KMOD_LMETA|KMOD_RMETA)
    325 
    326 #endif /* _SDL_keysym_h */
    327