KeySym.h

00001 /***************************************************************************
00002  *                                                                         *
00003  *   (c) Art Tevs, MPI Informatik Saarbruecken                             *
00004  *       mailto: <tevs@mpi-sb.mpg.de>                                      *
00005  *                                                                         *
00006  *   This program is free software; you can redistribute it and/or modify  *
00007  *   it under the terms of the GNU General Public License as published by  *
00008  *   the Free Software Foundation; either version 2 of the License, or     *
00009  *   (at your option) any later version.                                   *
00010  *                                                                         *
00011  ***************************************************************************
00012  *                                                                         *
00013  *    This definitions was get from SDL-Keysym. So you can directly map    *
00014  *    indices of nrEngine keys into SDL's own. I choosed this definition   *
00015  *    because of clearly defined key binding to ASCII-code.                *
00016  *    You can say: Why do this guy just not include sdl_keysym.h file. So my*
00017  *    answer is: Because we want to stay independet with our nrEngine.     *
00018  *    If you want to write new framework work class for our engine like    *
00019  *    GLFW-OpenGL-Framework, SDL, GLUT(OK not so great :-)) and so on, you *
00020  *    have to map keybindings from this engines to nrEngine owns. For some *
00021  *    not well written engines it can produce performance leck. Do it better*
00022  *    if you know how.                                                     *
00023  **************************************************************************/
00024 
00025 #ifndef __NR_KEY_SYMS_H_
00026 #define __NR_KEY_SYMS_H_
00027 
00028 
00029 /**
00030  * What we really want is a mapping of every raw key on the keyboard.
00031  *  To support international keyboards, we use the range 0xA1 - 0xFF
00032  *  as international virtual keycodes.  We'll follow in the footsteps of X11...
00033  *  The names of the keys
00034  * \ingroup gp
00035  */
00036 
00037 namespace nrEngine{
00038 
00039         typedef enum _KeyIndex {
00040                 /* The keyboard syms have been cleverly chosen to map to ASCII */
00041                 KEY_UNKNOWN             = 0,
00042                 KEY_FIRST                       = 0,
00043                 KEY_BACKSPACE           = 8,
00044                 KEY_TAB                 = 9,
00045                 KEY_CLEAR                       = 12,
00046                 KEY_RETURN              = 13,
00047                 KEY_PAUSE                       = 19,
00048                 KEY_ESCAPE              = 27,
00049                 KEY_SPACE                       = 32,
00050                 KEY_EXCLAIM             = 33,
00051                 KEY_QUOTEDBL            = 34,
00052                 KEY_HASH                        = 35,
00053                 KEY_DOLLAR              = 36,
00054                 KEY_AMPERSAND           = 38,
00055                 KEY_QUOTE                       = 39,
00056                 KEY_LEFTPAREN           = 40,
00057                 KEY_RIGHTPAREN  = 41,
00058                 KEY_ASTERISK            = 42,
00059                 KEY_PLUS                        = 43,
00060                 KEY_COMMA                       = 44,
00061                 KEY_MINUS                       = 45,
00062                 KEY_PERIOD              = 46,
00063                 KEY_SLASH                       = 47,
00064                 KEY_0                           = 48,
00065                 KEY_1                           = 49,
00066                 KEY_2                           = 50,
00067                 KEY_3                           = 51,
00068                 KEY_4                           = 52,
00069                 KEY_5                           = 53,
00070                 KEY_6                           = 54,
00071                 KEY_7                           = 55,
00072                 KEY_8                           = 56,
00073                 KEY_9                           = 57,
00074                 KEY_COLON                       = 58,
00075                 KEY_SEMICOLON           = 59,
00076                 KEY_LESS                        = 60,
00077                 KEY_EQUALS              = 61,
00078                 KEY_GREATER             = 62,
00079                 KEY_QUESTION            = 63,
00080                 KEY_AT                  = 64,
00081 
00082                 /*
00083                 Skip uppercase letters
00084                 */
00085                 KEY_LEFTBRACKET = 91,
00086                 KEY_BACKSLASH           = 92,
00087                 KEY_RIGHTBRACKET        = 93,
00088                 KEY_CARET                       = 94,
00089                 KEY_UNDERSCORE  = 95,
00090                 KEY_BACKQUOTE           = 96,
00091                 KEY_a                           = 97,
00092                 KEY_b                           = 98,
00093                 KEY_c                           = 99,
00094                 KEY_d                           = 100,
00095                 KEY_e                           = 101,
00096                 KEY_f                           = 102,
00097                 KEY_g                           = 103,
00098                 KEY_h                           = 104,
00099                 KEY_i                           = 105,
00100                 KEY_j                           = 106,
00101                 KEY_k                           = 107,
00102                 KEY_l                           = 108,
00103                 KEY_m                           = 109,
00104                 KEY_n                           = 110,
00105                 KEY_o                           = 111,
00106                 KEY_p                           = 112,
00107                 KEY_q                           = 113,
00108                 KEY_r                           = 114,
00109                 KEY_s                           = 115,
00110                 KEY_t                           = 116,
00111                 KEY_u                           = 117,
00112                 KEY_v                           = 118,
00113                 KEY_w                           = 119,
00114                 KEY_x                           = 120,
00115                 KEY_y                           = 121,
00116                 KEY_z                           = 122,
00117                 KEY_DELETE              = 127,
00118                 /* End of ASCII mapped keysyms */
00119 
00120 
00121                 /* International keyboard syms */
00122                 KEY_WORLD_0             = 160,          /* 0xA0 */
00123                 KEY_WORLD_1             = 161,
00124                 KEY_WORLD_2             = 162,
00125                 KEY_WORLD_3             = 163,
00126                 KEY_WORLD_4             = 164,
00127                 KEY_WORLD_5             = 165,
00128                 KEY_WORLD_6             = 166,
00129                 KEY_WORLD_7             = 167,
00130                 KEY_WORLD_8             = 168,
00131                 KEY_WORLD_9             = 169,
00132                 KEY_WORLD_10            = 170,
00133                 KEY_WORLD_11            = 171,
00134                 KEY_WORLD_12            = 172,
00135                 KEY_WORLD_13            = 173,
00136                 KEY_WORLD_14            = 174,
00137                 KEY_WORLD_15            = 175,
00138                 KEY_WORLD_16            = 176,
00139                 KEY_WORLD_17            = 177,
00140                 KEY_WORLD_18            = 178,
00141                 KEY_WORLD_19            = 179,
00142                 KEY_WORLD_20            = 180,
00143                 KEY_WORLD_21            = 181,
00144                 KEY_WORLD_22            = 182,
00145                 KEY_WORLD_23            = 183,
00146                 KEY_WORLD_24            = 184,
00147                 KEY_WORLD_25            = 185,
00148                 KEY_WORLD_26            = 186,
00149                 KEY_WORLD_27            = 187,
00150                 KEY_WORLD_28            = 188,
00151                 KEY_WORLD_29            = 189,
00152                 KEY_WORLD_30            = 190,
00153                 KEY_WORLD_31            = 191,
00154                 KEY_WORLD_32            = 192,
00155                 KEY_WORLD_33            = 193,
00156                 KEY_WORLD_34            = 194,
00157                 KEY_WORLD_35            = 195,
00158                 KEY_WORLD_36            = 196,
00159                 KEY_WORLD_37            = 197,
00160                 KEY_WORLD_38            = 198,
00161                 KEY_WORLD_39            = 199,
00162                 KEY_WORLD_40            = 200,
00163                 KEY_WORLD_41            = 201,
00164                 KEY_WORLD_42            = 202,
00165                 KEY_WORLD_43            = 203,
00166                 KEY_WORLD_44            = 204,
00167                 KEY_WORLD_45            = 205,
00168                 KEY_WORLD_46            = 206,
00169                 KEY_WORLD_47            = 207,
00170                 KEY_WORLD_48            = 208,
00171                 KEY_WORLD_49            = 209,
00172                 KEY_WORLD_50            = 210,
00173                 KEY_WORLD_51            = 211,
00174                 KEY_WORLD_52            = 212,
00175                 KEY_WORLD_53            = 213,
00176                 KEY_WORLD_54            = 214,
00177                 KEY_WORLD_55            = 215,
00178                 KEY_WORLD_56            = 216,
00179                 KEY_WORLD_57            = 217,
00180                 KEY_WORLD_58            = 218,
00181                 KEY_WORLD_59            = 219,
00182                 KEY_WORLD_60            = 220,
00183                 KEY_WORLD_61            = 221,
00184                 KEY_WORLD_62            = 222,
00185                 KEY_WORLD_63            = 223,
00186                 KEY_WORLD_64            = 224,
00187                 KEY_WORLD_65            = 225,
00188                 KEY_WORLD_66            = 226,
00189                 KEY_WORLD_67            = 227,
00190                 KEY_WORLD_68            = 228,
00191                 KEY_WORLD_69            = 229,
00192                 KEY_WORLD_70            = 230,
00193                 KEY_WORLD_71            = 231,
00194                 KEY_WORLD_72            = 232,
00195                 KEY_WORLD_73            = 233,
00196                 KEY_WORLD_74            = 234,
00197                 KEY_WORLD_75            = 235,
00198                 KEY_WORLD_76            = 236,
00199                 KEY_WORLD_77            = 237,
00200                 KEY_WORLD_78            = 238,
00201                 KEY_WORLD_79            = 239,
00202                 KEY_WORLD_80            = 240,
00203                 KEY_WORLD_81            = 241,
00204                 KEY_WORLD_82            = 242,
00205                 KEY_WORLD_83            = 243,
00206                 KEY_WORLD_84            = 244,
00207                 KEY_WORLD_85            = 245,
00208                 KEY_WORLD_86            = 246,
00209                 KEY_WORLD_87            = 247,
00210                 KEY_WORLD_88            = 248,
00211                 KEY_WORLD_89            = 249,
00212                 KEY_WORLD_90            = 250,
00213                 KEY_WORLD_91            = 251,
00214                 KEY_WORLD_92            = 252,
00215                 KEY_WORLD_93            = 253,
00216                 KEY_WORLD_94            = 254,
00217                 KEY_WORLD_95            = 255,          /* 0xFF */
00218 
00219                 /* Numeric keypad */
00220                 KEY_KP0         = 256,
00221                 KEY_KP1         = 257,
00222                 KEY_KP2         = 258,
00223                 KEY_KP3         = 259,
00224                 KEY_KP4         = 260,
00225                 KEY_KP5         = 261,
00226                 KEY_KP6         = 262,
00227                 KEY_KP7         = 263,
00228                 KEY_KP8         = 264,
00229                 KEY_KP9         = 265,
00230                 KEY_KP_PERIOD           = 266,
00231                 KEY_KP_DIVIDE           = 267,
00232                 KEY_KP_MULTIPLY = 268,
00233                 KEY_KP_MINUS            = 269,
00234                 KEY_KP_PLUS             = 270,
00235                 KEY_KP_ENTER            = 271,
00236                 KEY_KP_EQUALS           = 272,
00237 
00238                 /* Arrows + Home/End pad */
00239                 KEY_UP                  = 273,
00240                 KEY_DOWN                = 274,
00241                 KEY_RIGHT               = 275,
00242                 KEY_LEFT                = 276,
00243                 KEY_INSERT      = 277,
00244                 KEY_HOME                = 278,
00245                 KEY_END         = 279,
00246                 KEY_PAGEUP      = 280,
00247                 KEY_PAGEDOWN    = 281,
00248 
00249                 /* Function keys */
00250                 KEY_F1          = 282,
00251                 KEY_F2          = 283,
00252                 KEY_F3          = 284,
00253                 KEY_F4          = 285,
00254                 KEY_F5          = 286,
00255                 KEY_F6          = 287,
00256                 KEY_F7          = 288,
00257                 KEY_F8          = 289,
00258                 KEY_F9          = 290,
00259                 KEY_F10         = 291,
00260                 KEY_F11         = 292,
00261                 KEY_F12         = 293,
00262                 KEY_F13         = 294,
00263                 KEY_F14         = 295,
00264                 KEY_F15         = 296,
00265 
00266                 /* Key state modifier keys */
00267                 KEY_NUMLOCK     = 300,
00268                 KEY_CAPSLOCK    = 301,
00269                 KEY_SCROLLOCK   = 302,
00270                 KEY_RSHIFT      = 303,
00271                 KEY_LSHIFT      = 304,
00272                 KEY_RCTRL               = 305,
00273                 KEY_LCTRL               = 306,
00274                 KEY_RALT                = 307,
00275                 KEY_LALT                = 308,
00276                 KEY_RMETA               = 309,
00277                 KEY_LMETA               = 310,
00278                 KEY_LSUPER      = 311,          /* Left "Windows" key */
00279                 KEY_RSUPER      = 312,          /* Right "Windows" key */
00280                 KEY_MODE                = 313,          /* "Alt Gr" key */
00281                 KEY_COMPOSE     = 314,          /* Multi-key compose key */
00282 
00283                 /* Miscellaneous function keys */
00284                 KEY_HELP                = 315,
00285                 KEY_PRINT               = 316,
00286                 KEY_SYSREQ      = 317,
00287                 KEY_BREAK               = 318,
00288                 KEY_MENU                = 319,
00289                 KEY_POWER               = 320,          /* Power Macintosh power key */
00290                 KEY_EURO                = 321,          /* Some european keyboards */
00291                 KEY_UNDO                = 322,          /* Atari keyboard has Undo */
00292 
00293                 /* Add any other keys here */
00294 
00295                 KEY_LAST
00296 
00297         } keyIndex;
00298 
00299         /* Enumeration of valid key mods (possibly OR'd together) */
00300         /*typedef enum {
00301                 KMOD_NONE  = 0x0000,
00302                 KMOD_LSHIFT= 0x0001,
00303                 KMOD_RSHIFT= 0x0002,
00304                 KMOD_LCTRL = 0x0040,
00305                 KMOD_RCTRL = 0x0080,
00306                 KMOD_LALT  = 0x0100,
00307                 KMOD_RALT  = 0x0200,
00308                 KMOD_LMETA = 0x0400,
00309                 KMOD_RMETA = 0x0800,
00310                 KMOD_NUM   = 0x1000,
00311                 KMOD_CAPS  = 0x2000,
00312                 KMOD_MODE  = 0x4000,
00313                 KMOD_RESERVED = 0x8000
00314         } SDLMod;
00315 
00316         #define KMOD_CTRL       (KMOD_LCTRL|KMOD_RCTRL)
00317         #define KMOD_SHIFT      (KMOD_LSHIFT|KMOD_RSHIFT)
00318         #define KMOD_ALT        (KMOD_LALT|KMOD_RALT)
00319         #define KMOD_META       (KMOD_LMETA|KMOD_RMETA)
00320         */
00321 
00322         typedef enum _mouseButtonIndex{
00323 
00324                 BUTTON_LEFT,
00325                 BUTTON_RIGHT,
00326                 BUTTON_MIDDLE,
00327                 BUTTON_WHEEL,
00328                 BUTTON_WHEEL_UP,
00329                 BUTTON_WHEEL_DOWN,
00330 
00331                 BUTTON_COUNT
00332 
00333         } mouseButtonIndex;
00334 
00335 }; // end namespace
00336 #endif

Generated on Wed Sep 12 23:19:42 2007 for nrEngine by  doxygen 1.5.1