include/SDL_keysym.h
changeset 0 74212992fb08
child 184 3142d2ac11db
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/include/SDL_keysym.h	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,315 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Library General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Library General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Library General Public
    1.19 +    License along with this library; if not, write to the Free
    1.20 +    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@devolution.com
    1.24 +*/
    1.25 +
    1.26 +#ifdef SAVE_RCSID
    1.27 +static char rcsid =
    1.28 + "@(#) $Id$";
    1.29 +#endif
    1.30 +
    1.31 +#ifndef _SDL_keysym_h
    1.32 +#define _SDL_keysym_h
    1.33 +
    1.34 +/* What we really want is a mapping of every raw key on the keyboard.
    1.35 +   To support international keyboards, we use the range 0xA1 - 0xFF
    1.36 +   as international virtual keycodes.  We'll follow in the footsteps of X11...
    1.37 +   The names of the keys
    1.38 + */
    1.39 + 
    1.40 +typedef enum {
    1.41 +	/* The keyboard syms have been cleverly chosen to map to ASCII */
    1.42 +	SDLK_UNKNOWN		= 0,
    1.43 +	SDLK_FIRST		= 0,
    1.44 +	SDLK_BACKSPACE		= 8,
    1.45 +	SDLK_TAB		= 9,
    1.46 +	SDLK_CLEAR		= 12,
    1.47 +	SDLK_RETURN		= 13,
    1.48 +	SDLK_PAUSE		= 19,
    1.49 +	SDLK_ESCAPE		= 27,
    1.50 +	SDLK_SPACE		= 32,
    1.51 +	SDLK_EXCLAIM		= 33,
    1.52 +	SDLK_QUOTEDBL		= 34,
    1.53 +	SDLK_HASH		= 35,
    1.54 +	SDLK_DOLLAR		= 36,
    1.55 +	SDLK_AMPERSAND		= 38,
    1.56 +	SDLK_QUOTE		= 39,
    1.57 +	SDLK_LEFTPAREN		= 40,
    1.58 +	SDLK_RIGHTPAREN		= 41,
    1.59 +	SDLK_ASTERISK		= 42,
    1.60 +	SDLK_PLUS		= 43,
    1.61 +	SDLK_COMMA		= 44,
    1.62 +	SDLK_MINUS		= 45,
    1.63 +	SDLK_PERIOD		= 46,
    1.64 +	SDLK_SLASH		= 47,
    1.65 +	SDLK_0			= 48,
    1.66 +	SDLK_1			= 49,
    1.67 +	SDLK_2			= 50,
    1.68 +	SDLK_3			= 51,
    1.69 +	SDLK_4			= 52,
    1.70 +	SDLK_5			= 53,
    1.71 +	SDLK_6			= 54,
    1.72 +	SDLK_7			= 55,
    1.73 +	SDLK_8			= 56,
    1.74 +	SDLK_9			= 57,
    1.75 +	SDLK_COLON		= 58,
    1.76 +	SDLK_SEMICOLON		= 59,
    1.77 +	SDLK_LESS		= 60,
    1.78 +	SDLK_EQUALS		= 61,
    1.79 +	SDLK_GREATER		= 62,
    1.80 +	SDLK_QUESTION		= 63,
    1.81 +	SDLK_AT			= 64,
    1.82 +	/* 
    1.83 +	   Skip uppercase letters
    1.84 +	 */
    1.85 +	SDLK_LEFTBRACKET	= 91,
    1.86 +	SDLK_BACKSLASH		= 92,
    1.87 +	SDLK_RIGHTBRACKET	= 93,
    1.88 +	SDLK_CARET		= 94,
    1.89 +	SDLK_UNDERSCORE		= 95,
    1.90 +	SDLK_BACKQUOTE		= 96,
    1.91 +	SDLK_a			= 97,
    1.92 +	SDLK_b			= 98,
    1.93 +	SDLK_c			= 99,
    1.94 +	SDLK_d			= 100,
    1.95 +	SDLK_e			= 101,
    1.96 +	SDLK_f			= 102,
    1.97 +	SDLK_g			= 103,
    1.98 +	SDLK_h			= 104,
    1.99 +	SDLK_i			= 105,
   1.100 +	SDLK_j			= 106,
   1.101 +	SDLK_k			= 107,
   1.102 +	SDLK_l			= 108,
   1.103 +	SDLK_m			= 109,
   1.104 +	SDLK_n			= 110,
   1.105 +	SDLK_o			= 111,
   1.106 +	SDLK_p			= 112,
   1.107 +	SDLK_q			= 113,
   1.108 +	SDLK_r			= 114,
   1.109 +	SDLK_s			= 115,
   1.110 +	SDLK_t			= 116,
   1.111 +	SDLK_u			= 117,
   1.112 +	SDLK_v			= 118,
   1.113 +	SDLK_w			= 119,
   1.114 +	SDLK_x			= 120,
   1.115 +	SDLK_y			= 121,
   1.116 +	SDLK_z			= 122,
   1.117 +	SDLK_DELETE		= 127,
   1.118 +	/* End of ASCII mapped keysyms */
   1.119 +
   1.120 +	/* International keyboard syms */
   1.121 +	SDLK_WORLD_0		= 160,		/* 0xA0 */
   1.122 +	SDLK_WORLD_1		= 161,
   1.123 +	SDLK_WORLD_2		= 162,
   1.124 +	SDLK_WORLD_3		= 163,
   1.125 +	SDLK_WORLD_4		= 164,
   1.126 +	SDLK_WORLD_5		= 165,
   1.127 +	SDLK_WORLD_6		= 166,
   1.128 +	SDLK_WORLD_7		= 167,
   1.129 +	SDLK_WORLD_8		= 168,
   1.130 +	SDLK_WORLD_9		= 169,
   1.131 +	SDLK_WORLD_10		= 170,
   1.132 +	SDLK_WORLD_11		= 171,
   1.133 +	SDLK_WORLD_12		= 172,
   1.134 +	SDLK_WORLD_13		= 173,
   1.135 +	SDLK_WORLD_14		= 174,
   1.136 +	SDLK_WORLD_15		= 175,
   1.137 +	SDLK_WORLD_16		= 176,
   1.138 +	SDLK_WORLD_17		= 177,
   1.139 +	SDLK_WORLD_18		= 178,
   1.140 +	SDLK_WORLD_19		= 179,
   1.141 +	SDLK_WORLD_20		= 180,
   1.142 +	SDLK_WORLD_21		= 181,
   1.143 +	SDLK_WORLD_22		= 182,
   1.144 +	SDLK_WORLD_23		= 183,
   1.145 +	SDLK_WORLD_24		= 184,
   1.146 +	SDLK_WORLD_25		= 185,
   1.147 +	SDLK_WORLD_26		= 186,
   1.148 +	SDLK_WORLD_27		= 187,
   1.149 +	SDLK_WORLD_28		= 188,
   1.150 +	SDLK_WORLD_29		= 189,
   1.151 +	SDLK_WORLD_30		= 190,
   1.152 +	SDLK_WORLD_31		= 191,
   1.153 +	SDLK_WORLD_32		= 192,
   1.154 +	SDLK_WORLD_33		= 193,
   1.155 +	SDLK_WORLD_34		= 194,
   1.156 +	SDLK_WORLD_35		= 195,
   1.157 +	SDLK_WORLD_36		= 196,
   1.158 +	SDLK_WORLD_37		= 197,
   1.159 +	SDLK_WORLD_38		= 198,
   1.160 +	SDLK_WORLD_39		= 199,
   1.161 +	SDLK_WORLD_40		= 200,
   1.162 +	SDLK_WORLD_41		= 201,
   1.163 +	SDLK_WORLD_42		= 202,
   1.164 +	SDLK_WORLD_43		= 203,
   1.165 +	SDLK_WORLD_44		= 204,
   1.166 +	SDLK_WORLD_45		= 205,
   1.167 +	SDLK_WORLD_46		= 206,
   1.168 +	SDLK_WORLD_47		= 207,
   1.169 +	SDLK_WORLD_48		= 208,
   1.170 +	SDLK_WORLD_49		= 209,
   1.171 +	SDLK_WORLD_50		= 210,
   1.172 +	SDLK_WORLD_51		= 211,
   1.173 +	SDLK_WORLD_52		= 212,
   1.174 +	SDLK_WORLD_53		= 213,
   1.175 +	SDLK_WORLD_54		= 214,
   1.176 +	SDLK_WORLD_55		= 215,
   1.177 +	SDLK_WORLD_56		= 216,
   1.178 +	SDLK_WORLD_57		= 217,
   1.179 +	SDLK_WORLD_58		= 218,
   1.180 +	SDLK_WORLD_59		= 219,
   1.181 +	SDLK_WORLD_60		= 220,
   1.182 +	SDLK_WORLD_61		= 221,
   1.183 +	SDLK_WORLD_62		= 222,
   1.184 +	SDLK_WORLD_63		= 223,
   1.185 +	SDLK_WORLD_64		= 224,
   1.186 +	SDLK_WORLD_65		= 225,
   1.187 +	SDLK_WORLD_66		= 226,
   1.188 +	SDLK_WORLD_67		= 227,
   1.189 +	SDLK_WORLD_68		= 228,
   1.190 +	SDLK_WORLD_69		= 229,
   1.191 +	SDLK_WORLD_70		= 230,
   1.192 +	SDLK_WORLD_71		= 231,
   1.193 +	SDLK_WORLD_72		= 232,
   1.194 +	SDLK_WORLD_73		= 233,
   1.195 +	SDLK_WORLD_74		= 234,
   1.196 +	SDLK_WORLD_75		= 235,
   1.197 +	SDLK_WORLD_76		= 236,
   1.198 +	SDLK_WORLD_77		= 237,
   1.199 +	SDLK_WORLD_78		= 238,
   1.200 +	SDLK_WORLD_79		= 239,
   1.201 +	SDLK_WORLD_80		= 240,
   1.202 +	SDLK_WORLD_81		= 241,
   1.203 +	SDLK_WORLD_82		= 242,
   1.204 +	SDLK_WORLD_83		= 243,
   1.205 +	SDLK_WORLD_84		= 244,
   1.206 +	SDLK_WORLD_85		= 245,
   1.207 +	SDLK_WORLD_86		= 246,
   1.208 +	SDLK_WORLD_87		= 247,
   1.209 +	SDLK_WORLD_88		= 248,
   1.210 +	SDLK_WORLD_89		= 249,
   1.211 +	SDLK_WORLD_90		= 250,
   1.212 +	SDLK_WORLD_91		= 251,
   1.213 +	SDLK_WORLD_92		= 252,
   1.214 +	SDLK_WORLD_93		= 253,
   1.215 +	SDLK_WORLD_94		= 254,
   1.216 +	SDLK_WORLD_95		= 255,		/* 0xFF */
   1.217 +
   1.218 +	/* Numeric keypad */
   1.219 +	SDLK_KP0		= 256,
   1.220 +	SDLK_KP1		= 257,
   1.221 +	SDLK_KP2		= 258,
   1.222 +	SDLK_KP3		= 259,
   1.223 +	SDLK_KP4		= 260,
   1.224 +	SDLK_KP5		= 261,
   1.225 +	SDLK_KP6		= 262,
   1.226 +	SDLK_KP7		= 263,
   1.227 +	SDLK_KP8		= 264,
   1.228 +	SDLK_KP9		= 265,
   1.229 +	SDLK_KP_PERIOD		= 266,
   1.230 +	SDLK_KP_DIVIDE		= 267,
   1.231 +	SDLK_KP_MULTIPLY	= 268,
   1.232 +	SDLK_KP_MINUS		= 269,
   1.233 +	SDLK_KP_PLUS		= 270,
   1.234 +	SDLK_KP_ENTER		= 271,
   1.235 +	SDLK_KP_EQUALS		= 272,
   1.236 +
   1.237 +	/* Arrows + Home/End pad */
   1.238 +	SDLK_UP			= 273,
   1.239 +	SDLK_DOWN		= 274,
   1.240 +	SDLK_RIGHT		= 275,
   1.241 +	SDLK_LEFT		= 276,
   1.242 +	SDLK_INSERT		= 277,
   1.243 +	SDLK_HOME		= 278,
   1.244 +	SDLK_END		= 279,
   1.245 +	SDLK_PAGEUP		= 280,
   1.246 +	SDLK_PAGEDOWN		= 281,
   1.247 +
   1.248 +	/* Function keys */
   1.249 +	SDLK_F1			= 282,
   1.250 +	SDLK_F2			= 283,
   1.251 +	SDLK_F3			= 284,
   1.252 +	SDLK_F4			= 285,
   1.253 +	SDLK_F5			= 286,
   1.254 +	SDLK_F6			= 287,
   1.255 +	SDLK_F7			= 288,
   1.256 +	SDLK_F8			= 289,
   1.257 +	SDLK_F9			= 290,
   1.258 +	SDLK_F10		= 291,
   1.259 +	SDLK_F11		= 292,
   1.260 +	SDLK_F12		= 293,
   1.261 +	SDLK_F13		= 294,
   1.262 +	SDLK_F14		= 295,
   1.263 +	SDLK_F15		= 296,
   1.264 +
   1.265 +	/* Key state modifier keys */
   1.266 +	SDLK_NUMLOCK		= 300,
   1.267 +	SDLK_CAPSLOCK		= 301,
   1.268 +	SDLK_SCROLLOCK		= 302,
   1.269 +	SDLK_RSHIFT		= 303,
   1.270 +	SDLK_LSHIFT		= 304,
   1.271 +	SDLK_RCTRL		= 305,
   1.272 +	SDLK_LCTRL		= 306,
   1.273 +	SDLK_RALT		= 307,
   1.274 +	SDLK_LALT		= 308,
   1.275 +	SDLK_RMETA		= 309,
   1.276 +	SDLK_LMETA		= 310,
   1.277 +	SDLK_LSUPER		= 311,		/* Left "Windows" key */
   1.278 +	SDLK_RSUPER		= 312,		/* Right "Windows" key */
   1.279 +	SDLK_MODE		= 313,		/* "Alt Gr" key */
   1.280 +	SDLK_COMPOSE		= 314,		/* Multi-key compose key */
   1.281 +
   1.282 +	/* Miscellaneous function keys */
   1.283 +	SDLK_HELP		= 315,
   1.284 +	SDLK_PRINT		= 316,
   1.285 +	SDLK_SYSREQ		= 317,
   1.286 +	SDLK_BREAK		= 318,
   1.287 +	SDLK_MENU		= 319,
   1.288 +	SDLK_POWER		= 320,		/* Power Macintosh power key */
   1.289 +	SDLK_EURO		= 321,		/* Some european keyboards */
   1.290 +
   1.291 +	/* Add any other keys here */
   1.292 +
   1.293 +	SDLK_LAST
   1.294 +} SDLKey;
   1.295 +
   1.296 +/* Enumeration of valid key mods (possibly OR'd together) */
   1.297 +typedef enum {
   1.298 +	KMOD_NONE  = 0x0000,
   1.299 +	KMOD_LSHIFT= 0x0001,
   1.300 +	KMOD_RSHIFT= 0x0002,
   1.301 +	KMOD_LCTRL = 0x0040,
   1.302 +	KMOD_RCTRL = 0x0080,
   1.303 +	KMOD_LALT  = 0x0100,
   1.304 +	KMOD_RALT  = 0x0200,
   1.305 +	KMOD_LMETA = 0x0400,
   1.306 +	KMOD_RMETA = 0x0800,
   1.307 +	KMOD_NUM   = 0x1000,
   1.308 +	KMOD_CAPS  = 0x2000,
   1.309 +	KMOD_MODE  = 0x4000,
   1.310 +	KMOD_RESERVED = 0x8000
   1.311 +} SDLMod;
   1.312 +
   1.313 +#define KMOD_CTRL	(KMOD_LCTRL|KMOD_RCTRL)
   1.314 +#define KMOD_SHIFT	(KMOD_LSHIFT|KMOD_RSHIFT)
   1.315 +#define KMOD_ALT	(KMOD_LALT|KMOD_RALT)
   1.316 +#define KMOD_META	(KMOD_LMETA|KMOD_RMETA)
   1.317 +
   1.318 +#endif /* _SDL_keysym_h */