include/SDL_keysym.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 10 Jul 2006 21:04:37 +0000
changeset 1895 c121d94672cb
parent 1312 c9b51268668f
child 2268 4baee598306d
permissions -rw-r--r--
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
slouken@0
     1
/*
slouken@0
     2
    SDL - Simple DirectMedia Layer
slouken@1312
     3
    Copyright (C) 1997-2006 Sam Lantinga
slouken@0
     4
slouken@0
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@0
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 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@1312
    13
    Lesser General Public License for more details.
slouken@0
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@0
    18
slouken@0
    19
    Sam Lantinga
slouken@251
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@0
    22
slouken@1895
    23
/**
slouken@1895
    24
 * \file SDL_keysym.h
slouken@1895
    25
 */
slouken@1895
    26
slouken@0
    27
#ifndef _SDL_keysym_h
slouken@0
    28
#define _SDL_keysym_h
slouken@0
    29
slouken@1895
    30
/**
slouken@1895
    31
 * \enum SDLKey
slouken@1895
    32
 *
slouken@1895
    33
 * \brief The SDL virtual key representation
slouken@1895
    34
 *
slouken@1895
    35
 * The SDLKey represents the unmodified character printed on the key
slouken@1895
    36
 * for the current keyboard layout.  The first 255 characters are used
slouken@1895
    37
 * unchanged from Latin-1, e.g. a key with 'a' on it will have the value "a".
slouken@1895
    38
 * The rest of the keys are named below, and fall into the range above 255.
slouken@0
    39
 */
slouken@1895
    40
typedef enum
slouken@1895
    41
{
slouken@1895
    42
    /* The keyboard syms have been cleverly chosen to map to ASCII */
slouken@1895
    43
    SDLK_UNKNOWN = 0,
slouken@1895
    44
    SDLK_FIRST = 0,
slouken@1895
    45
    SDLK_BACKSPACE = 8,
slouken@1895
    46
    SDLK_TAB = 9,
slouken@1895
    47
    SDLK_CLEAR = 12,
slouken@1895
    48
    SDLK_RETURN = 13,
slouken@1895
    49
    SDLK_PAUSE = 19,
slouken@1895
    50
    SDLK_ESCAPE = 27,
slouken@1895
    51
    SDLK_SPACE = 32,
slouken@1895
    52
    SDLK_EXCLAIM = 33,
slouken@1895
    53
    SDLK_QUOTEDBL = 34,
slouken@1895
    54
    SDLK_HASH = 35,
slouken@1895
    55
    SDLK_DOLLAR = 36,
slouken@1895
    56
    SDLK_AMPERSAND = 38,
slouken@1895
    57
    SDLK_QUOTE = 39,
slouken@1895
    58
    SDLK_LEFTPAREN = 40,
slouken@1895
    59
    SDLK_RIGHTPAREN = 41,
slouken@1895
    60
    SDLK_ASTERISK = 42,
slouken@1895
    61
    SDLK_PLUS = 43,
slouken@1895
    62
    SDLK_COMMA = 44,
slouken@1895
    63
    SDLK_MINUS = 45,
slouken@1895
    64
    SDLK_PERIOD = 46,
slouken@1895
    65
    SDLK_SLASH = 47,
slouken@1895
    66
    SDLK_0 = 48,
slouken@1895
    67
    SDLK_1 = 49,
slouken@1895
    68
    SDLK_2 = 50,
slouken@1895
    69
    SDLK_3 = 51,
slouken@1895
    70
    SDLK_4 = 52,
slouken@1895
    71
    SDLK_5 = 53,
slouken@1895
    72
    SDLK_6 = 54,
slouken@1895
    73
    SDLK_7 = 55,
slouken@1895
    74
    SDLK_8 = 56,
slouken@1895
    75
    SDLK_9 = 57,
slouken@1895
    76
    SDLK_COLON = 58,
slouken@1895
    77
    SDLK_SEMICOLON = 59,
slouken@1895
    78
    SDLK_LESS = 60,
slouken@1895
    79
    SDLK_EQUALS = 61,
slouken@1895
    80
    SDLK_GREATER = 62,
slouken@1895
    81
    SDLK_QUESTION = 63,
slouken@1895
    82
    SDLK_AT = 64,
slouken@1895
    83
    /* 
slouken@1895
    84
       Skip uppercase letters
slouken@1895
    85
     */
slouken@1895
    86
    SDLK_LEFTBRACKET = 91,
slouken@1895
    87
    SDLK_BACKSLASH = 92,
slouken@1895
    88
    SDLK_RIGHTBRACKET = 93,
slouken@1895
    89
    SDLK_CARET = 94,
slouken@1895
    90
    SDLK_UNDERSCORE = 95,
slouken@1895
    91
    SDLK_BACKQUOTE = 96,
slouken@1895
    92
    SDLK_a = 97,
slouken@1895
    93
    SDLK_b = 98,
slouken@1895
    94
    SDLK_c = 99,
slouken@1895
    95
    SDLK_d = 100,
slouken@1895
    96
    SDLK_e = 101,
slouken@1895
    97
    SDLK_f = 102,
slouken@1895
    98
    SDLK_g = 103,
slouken@1895
    99
    SDLK_h = 104,
slouken@1895
   100
    SDLK_i = 105,
slouken@1895
   101
    SDLK_j = 106,
slouken@1895
   102
    SDLK_k = 107,
slouken@1895
   103
    SDLK_l = 108,
slouken@1895
   104
    SDLK_m = 109,
slouken@1895
   105
    SDLK_n = 110,
slouken@1895
   106
    SDLK_o = 111,
slouken@1895
   107
    SDLK_p = 112,
slouken@1895
   108
    SDLK_q = 113,
slouken@1895
   109
    SDLK_r = 114,
slouken@1895
   110
    SDLK_s = 115,
slouken@1895
   111
    SDLK_t = 116,
slouken@1895
   112
    SDLK_u = 117,
slouken@1895
   113
    SDLK_v = 118,
slouken@1895
   114
    SDLK_w = 119,
slouken@1895
   115
    SDLK_x = 120,
slouken@1895
   116
    SDLK_y = 121,
slouken@1895
   117
    SDLK_z = 122,
slouken@1895
   118
    SDLK_DELETE = 127,
slouken@1895
   119
    /* End of ASCII mapped keysyms */
slouken@0
   120
slouken@1895
   121
    /* Numeric keypad */
slouken@1895
   122
    SDLK_KP0 = 256,
slouken@1895
   123
    SDLK_KP1 = 257,
slouken@1895
   124
    SDLK_KP2 = 258,
slouken@1895
   125
    SDLK_KP3 = 259,
slouken@1895
   126
    SDLK_KP4 = 260,
slouken@1895
   127
    SDLK_KP5 = 261,
slouken@1895
   128
    SDLK_KP6 = 262,
slouken@1895
   129
    SDLK_KP7 = 263,
slouken@1895
   130
    SDLK_KP8 = 264,
slouken@1895
   131
    SDLK_KP9 = 265,
slouken@1895
   132
    SDLK_KP_PERIOD = 266,
slouken@1895
   133
    SDLK_KP_DIVIDE = 267,
slouken@1895
   134
    SDLK_KP_MULTIPLY = 268,
slouken@1895
   135
    SDLK_KP_MINUS = 269,
slouken@1895
   136
    SDLK_KP_PLUS = 270,
slouken@1895
   137
    SDLK_KP_ENTER = 271,
slouken@1895
   138
    SDLK_KP_EQUALS = 272,
slouken@0
   139
slouken@1895
   140
    /* Arrows + Home/End pad */
slouken@1895
   141
    SDLK_UP = 273,
slouken@1895
   142
    SDLK_DOWN = 274,
slouken@1895
   143
    SDLK_RIGHT = 275,
slouken@1895
   144
    SDLK_LEFT = 276,
slouken@1895
   145
    SDLK_INSERT = 277,
slouken@1895
   146
    SDLK_HOME = 278,
slouken@1895
   147
    SDLK_END = 279,
slouken@1895
   148
    SDLK_PAGEUP = 280,
slouken@1895
   149
    SDLK_PAGEDOWN = 281,
slouken@0
   150
slouken@1895
   151
    /* Function keys */
slouken@1895
   152
    SDLK_F1 = 282,
slouken@1895
   153
    SDLK_F2 = 283,
slouken@1895
   154
    SDLK_F3 = 284,
slouken@1895
   155
    SDLK_F4 = 285,
slouken@1895
   156
    SDLK_F5 = 286,
slouken@1895
   157
    SDLK_F6 = 287,
slouken@1895
   158
    SDLK_F7 = 288,
slouken@1895
   159
    SDLK_F8 = 289,
slouken@1895
   160
    SDLK_F9 = 290,
slouken@1895
   161
    SDLK_F10 = 291,
slouken@1895
   162
    SDLK_F11 = 292,
slouken@1895
   163
    SDLK_F12 = 293,
slouken@1895
   164
    SDLK_F13 = 294,
slouken@1895
   165
    SDLK_F14 = 295,
slouken@1895
   166
    SDLK_F15 = 296,
slouken@0
   167
slouken@1895
   168
    /* Key state modifier keys */
slouken@1895
   169
    SDLK_NUMLOCK = 300,
slouken@1895
   170
    SDLK_CAPSLOCK = 301,
slouken@1895
   171
    SDLK_SCROLLOCK = 302,
slouken@1895
   172
    SDLK_RSHIFT = 303,
slouken@1895
   173
    SDLK_LSHIFT = 304,
slouken@1895
   174
    SDLK_RCTRL = 305,
slouken@1895
   175
    SDLK_LCTRL = 306,
slouken@1895
   176
    SDLK_RALT = 307,
slouken@1895
   177
    SDLK_LALT = 308,
slouken@1895
   178
    SDLK_RMETA = 309,
slouken@1895
   179
    SDLK_LMETA = 310,
slouken@1895
   180
    SDLK_LSUPER = 311,          /**< Left "Windows" key */
slouken@1895
   181
    SDLK_RSUPER = 312,          /**< Right "Windows" key */
slouken@1895
   182
    SDLK_MODE = 313,            /**< "Alt Gr" key */
slouken@1895
   183
    SDLK_COMPOSE = 314,         /**< Multi-key compose key */
slouken@0
   184
slouken@1895
   185
    /* Miscellaneous function keys */
slouken@1895
   186
    SDLK_HELP = 315,
slouken@1895
   187
    SDLK_PRINT = 316,
slouken@1895
   188
    SDLK_SYSREQ = 317,
slouken@1895
   189
    SDLK_BREAK = 318,
slouken@1895
   190
    SDLK_MENU = 319,
slouken@1895
   191
    SDLK_POWER = 320,           /**< Power Macintosh power key */
slouken@1895
   192
    SDLK_EURO = 321,            /**< Some european keyboards */
slouken@1895
   193
    SDLK_UNDO = 322,            /**< Atari keyboard has Undo */
slouken@0
   194
slouken@1895
   195
    /* Add any other keys here */
slouken@0
   196
slouken@1895
   197
    SDLK_LAST
slouken@0
   198
} SDLKey;
slouken@0
   199
slouken@1895
   200
/**
slouken@1895
   201
 * \enum SDLMod
slouken@1895
   202
 *
slouken@1895
   203
 * \brief Enumeration of valid key mods (possibly OR'd together)
slouken@1895
   204
 */
slouken@1895
   205
typedef enum
slouken@1895
   206
{
slouken@1895
   207
    KMOD_NONE = 0x0000,
slouken@1895
   208
    KMOD_LSHIFT = 0x0001,
slouken@1895
   209
    KMOD_RSHIFT = 0x0002,
slouken@1895
   210
    KMOD_LCTRL = 0x0040,
slouken@1895
   211
    KMOD_RCTRL = 0x0080,
slouken@1895
   212
    KMOD_LALT = 0x0100,
slouken@1895
   213
    KMOD_RALT = 0x0200,
slouken@1895
   214
    KMOD_LMETA = 0x0400,
slouken@1895
   215
    KMOD_RMETA = 0x0800,
slouken@1895
   216
    KMOD_NUM = 0x1000,
slouken@1895
   217
    KMOD_CAPS = 0x2000,
slouken@1895
   218
    KMOD_MODE = 0x4000,
slouken@1895
   219
    KMOD_RESERVED = 0x8000
slouken@0
   220
} SDLMod;
slouken@0
   221
slouken@0
   222
#define KMOD_CTRL	(KMOD_LCTRL|KMOD_RCTRL)
slouken@0
   223
#define KMOD_SHIFT	(KMOD_LSHIFT|KMOD_RSHIFT)
slouken@0
   224
#define KMOD_ALT	(KMOD_LALT|KMOD_RALT)
slouken@0
   225
#define KMOD_META	(KMOD_LMETA|KMOD_RMETA)
slouken@0
   226
slouken@0
   227
#endif /* _SDL_keysym_h */