Input.h

00001 /*
00002  * This source file is part of libRocket, the HTML/CSS Interface Middleware
00003  *
00004  * For the latest information, see http://www.librocket.com
00005  *
00006  * Copyright (c) 2008-2010 CodePoint Ltd, Shift Technology Ltd
00007  *
00008  * Permission is hereby granted, free of charge, to any person obtaining a copy
00009  * of this software and associated documentation files (the "Software"), to deal
00010  * in the Software without restriction, including without limitation the rights
00011  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00012  * copies of the Software, and to permit persons to whom the Software is
00013  * furnished to do so, subject to the following conditions:
00014  *
00015  * The above copyright notice and this permission notice shall be included in
00016  * all copies or substantial portions of the Software.
00017  * 
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00019  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00020  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00021  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00022  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00023  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00024  * THE SOFTWARE.
00025  *
00026  */
00027 
00028 #ifndef ROCKETCOREINPUT_H
00029 #define ROCKETCOREINPUT_H
00030 
00031 namespace Rocket {
00032 namespace Core {
00033 
00034 /*
00035         Enumerants for sending input events into Rocket.
00036 
00037         @author Peter Curry
00038  */
00039 
00040 namespace Input
00041 {
00042         enum KeyIdentifier
00043         {
00044                 KI_UNKNOWN = 0,
00045 
00046                 KI_SPACE = 1,
00047 
00048                 KI_0 = 2,
00049                 KI_1 = 3,
00050                 KI_2 = 4,
00051                 KI_3 = 5,
00052                 KI_4 = 6,
00053                 KI_5 = 7,
00054                 KI_6 = 8,
00055                 KI_7 = 9,
00056                 KI_8 = 10,
00057                 KI_9 = 11,
00058 
00059                 KI_A = 12,
00060                 KI_B = 13,
00061                 KI_C = 14,
00062                 KI_D = 15,
00063                 KI_E = 16,
00064                 KI_F = 17,
00065                 KI_G = 18,
00066                 KI_H = 19,
00067                 KI_I = 20,
00068                 KI_J = 21,
00069                 KI_K = 22,
00070                 KI_L = 23,
00071                 KI_M = 24,
00072                 KI_N = 25,
00073                 KI_O = 26,
00074                 KI_P = 27,
00075                 KI_Q = 28,
00076                 KI_R = 29,
00077                 KI_S = 30,
00078                 KI_T = 31,
00079                 KI_U = 32,
00080                 KI_V = 33,
00081                 KI_W = 34,
00082                 KI_X = 35,
00083                 KI_Y = 36,
00084                 KI_Z = 37,
00085 
00086                 KI_OEM_1 = 38,                          // US standard keyboard; the ';:' key.
00087                 KI_OEM_PLUS = 39,                       // Any region; the '=+' key.
00088                 KI_OEM_COMMA = 40,                      // Any region; the ',<' key.
00089                 KI_OEM_MINUS = 41,                      // Any region; the '-_' key.
00090                 KI_OEM_PERIOD = 42,                     // Any region; the '.>' key.
00091                 KI_OEM_2 = 43,                          // Any region; the '/?' key.
00092                 KI_OEM_3 = 44,                          // Any region; the '`~' key.
00093 
00094                 KI_OEM_4 = 45,                          // US standard keyboard; the '[{' key.
00095                 KI_OEM_5 = 46,                          // US standard keyboard; the '\|' key.
00096                 KI_OEM_6 = 47,                          // US standard keyboard; the ']}' key.
00097                 KI_OEM_7 = 48,                          // US standard keyboard; the ''"' key.
00098                 KI_OEM_8 = 49,
00099 
00100                 KI_OEM_102 = 50,                        // RT 102-key keyboard; the '<>' or '\|' key.
00101 
00102                 KI_NUMPAD0 = 51,
00103                 KI_NUMPAD1 = 52,
00104                 KI_NUMPAD2 = 53,
00105                 KI_NUMPAD3 = 54,
00106                 KI_NUMPAD4 = 55,
00107                 KI_NUMPAD5 = 56,
00108                 KI_NUMPAD6 = 57,
00109                 KI_NUMPAD7 = 58,
00110                 KI_NUMPAD8 = 59,
00111                 KI_NUMPAD9 = 60,
00112                 KI_NUMPADENTER = 61,
00113                 KI_MULTIPLY = 62,                       // Asterisk on the numeric keypad.
00114                 KI_ADD = 63,                            // Plus on the numeric keypad.
00115                 KI_SEPARATOR = 64,
00116                 KI_SUBTRACT = 65,                       // Minus on the numeric keypad.
00117                 KI_DECIMAL = 66,                        // Period on the numeric keypad.
00118                 KI_DIVIDE = 67,                         // Forward Slash on the numeric keypad.
00119 
00120                 /*
00121                  * NEC PC-9800 kbd definitions
00122                  */
00123                 KI_OEM_NEC_EQUAL = 68,          // Equals key on the numeric keypad.
00124 
00125                 KI_BACK = 69,                           // Backspace key.
00126                 KI_TAB = 70,                            // Tab key.
00127 
00128                 KI_CLEAR = 71,
00129                 KI_RETURN = 72,
00130 
00131                 KI_PAUSE = 73,
00132                 KI_CAPITAL = 74,                        // Capslock key.
00133 
00134                 KI_KANA = 75,                           // IME Kana mode.
00135                 KI_HANGUL = 76,                         // IME Hangul mode.
00136                 KI_JUNJA = 77,                          // IME Junja mode.
00137                 KI_FINAL = 78,                          // IME final mode.
00138                 KI_HANJA = 79,                          // IME Hanja mode.
00139                 KI_KANJI = 80,                          // IME Kanji mode.
00140 
00141                 KI_ESCAPE = 81,                         // Escape key.
00142 
00143                 KI_CONVERT = 82,                        // IME convert.
00144                 KI_NONCONVERT = 83,                     // IME nonconvert.
00145                 KI_ACCEPT = 84,                         // IME accept.
00146                 KI_MODECHANGE = 85,                     // IME mode change request.
00147 
00148                 KI_PRIOR = 86,                          // Page Up key.
00149                 KI_NEXT = 87,                           // Page Down key.
00150                 KI_END = 88,
00151                 KI_HOME = 89,
00152                 KI_LEFT = 90,                           // Left Arrow key.
00153                 KI_UP = 91,                                     // Up Arrow key.
00154                 KI_RIGHT = 92,                          // Right Arrow key.
00155                 KI_DOWN = 93,                           // Down Arrow key.
00156                 KI_SELECT = 94,
00157                 KI_PRINT = 95,
00158                 KI_EXECUTE = 96,
00159                 KI_SNAPSHOT = 97,                       // Print Screen key.
00160                 KI_INSERT = 98,
00161                 KI_DELETE = 99,
00162                 KI_HELP = 100,
00163 
00164                 KI_LWIN = 101,                          // Left Windows key.
00165                 KI_RWIN = 102,                          // Right Windows key.
00166                 KI_APPS = 103,                          // Applications key.
00167 
00168                 KI_POWER = 104,
00169                 KI_SLEEP = 105,
00170                 KI_WAKE = 106,
00171 
00172                 KI_F1 = 107,
00173                 KI_F2 = 108,
00174                 KI_F3 = 109,
00175                 KI_F4 = 110,
00176                 KI_F5 = 111,
00177                 KI_F6 = 112,
00178                 KI_F7 = 113,
00179                 KI_F8 = 114,
00180                 KI_F9 = 115,
00181                 KI_F10 = 116,
00182                 KI_F11 = 117,
00183                 KI_F12 = 118,
00184                 KI_F13 = 119,
00185                 KI_F14 = 120,
00186                 KI_F15 = 121,
00187                 KI_F16 = 122,
00188                 KI_F17 = 123,
00189                 KI_F18 = 124,
00190                 KI_F19 = 125,
00191                 KI_F20 = 126,
00192                 KI_F21 = 127,
00193                 KI_F22 = 128,
00194                 KI_F23 = 129,
00195                 KI_F24 = 130,
00196 
00197                 KI_NUMLOCK = 131,                       // Numlock key.
00198                 KI_SCROLL = 132,                        // Scroll Lock key.
00199 
00200                 /*
00201                  * Fujitsu/OASYS kbd definitions
00202                  */
00203                 KI_OEM_FJ_JISHO = 133,          // 'Dictionary' key.
00204                 KI_OEM_FJ_MASSHOU = 134,        // 'Unregister word' key.
00205                 KI_OEM_FJ_TOUROKU = 135,        // 'Register word' key.
00206                 KI_OEM_FJ_LOYA = 136,           // 'Left OYAYUBI' key.
00207                 KI_OEM_FJ_ROYA = 137,           // 'Right OYAYUBI' key.
00208 
00209                 KI_LSHIFT = 138,
00210                 KI_RSHIFT = 139,
00211                 KI_LCONTROL = 140,
00212                 KI_RCONTROL = 141,
00213                 KI_LMENU = 142,
00214                 KI_RMENU = 143,
00215 
00216                 KI_BROWSER_BACK = 144,
00217                 KI_BROWSER_FORWARD = 145,
00218                 KI_BROWSER_REFRESH = 146,
00219                 KI_BROWSER_STOP = 147,
00220                 KI_BROWSER_SEARCH = 148,
00221                 KI_BROWSER_FAVORITES = 149,
00222                 KI_BROWSER_HOME = 150,
00223 
00224                 KI_VOLUME_MUTE = 151,
00225                 KI_VOLUME_DOWN = 152,
00226                 KI_VOLUME_UP = 153,
00227                 KI_MEDIA_NEXT_TRACK = 154,
00228                 KI_MEDIA_PREV_TRACK = 155,
00229                 KI_MEDIA_STOP = 156,
00230                 KI_MEDIA_PLAY_PAUSE = 157,
00231                 KI_LAUNCH_MAIL = 158,
00232                 KI_LAUNCH_MEDIA_SELECT = 159,
00233                 KI_LAUNCH_APP1 = 160,
00234                 KI_LAUNCH_APP2 = 161,
00235 
00236                 /*
00237                  * Various extended or enhanced keyboards
00238                  */
00239                 KI_OEM_AX = 162,
00240                 KI_ICO_HELP = 163,
00241                 KI_ICO_00 = 164,
00242 
00243                 KI_PROCESSKEY = 165,            // IME Process key.
00244 
00245                 KI_ICO_CLEAR = 166,
00246 
00247                 KI_ATTN = 167,
00248                 KI_CRSEL = 168,
00249                 KI_EXSEL = 169,
00250                 KI_EREOF = 170,
00251                 KI_PLAY = 171,
00252                 KI_ZOOM = 172,
00253                 KI_PA1 = 173,
00254                 KI_OEM_CLEAR = 174,
00255 
00256                 KI_LMETA = 175,
00257                 KI_RMETA = 176
00258         };
00259 
00260         enum KeyModifier
00261         {
00262                 KM_CTRL = 1 << 0,               // Set if at least one Ctrl key is depressed.
00263                 KM_SHIFT = 1 << 1,              // Set if at least one Shift key is depressed.
00264                 KM_ALT = 1 << 2,                // Set if at least one Alt key is depressed.
00265                 KM_META = 1 << 3,               // Set if at least one Meta key (the command key) is depressed.
00266                 KM_CAPSLOCK = 1 << 4,   // Set if caps lock is enabled.
00267                 KM_NUMLOCK = 1 << 5,    // Set if num lock is enabled.
00268                 KM_SCROLLLOCK = 1 << 6  // Set if scroll lock is enabled.
00269         };
00270 }
00271 
00272 }
00273 }
00274 
00275 #endif