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