Hacked some input and entity commands into the engine.
[peakengine.git] / engine / include / core / Keycode.h
blobbe76993b7afa3c1ce5e12633f1b58e3298d5bbe9
1 /*
2 Copyright (C) 2008 Lukas Kropatschek
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 #ifndef _KEYCODE_H_
23 #define _KEYCODE_H_
25 #include <string>
27 //tolua_begin
28 namespace peak
31 enum Keycode
33 EK_NONE = 0x00,
34 EK_LBUTTON = 0x01, // Left mouse button
35 EK_RBUTTON = 0x02, // Right mouse button
36 EK_CANCEL = 0x03, // Control-break processing
37 EK_MBUTTON = 0x04, // Middle mouse button (three-button mouse)
38 EK_XBUTTON1 = 0x05, // Windows 2000/XP: X1 mouse button
39 EK_XBUTTON2 = 0x06, // Windows 2000/XP: X2 mouse button
40 EK_BACK = 0x08, // BACKSPACE key
41 EK_TAB = 0x09, // TAB key
42 EK_CLEAR = 0x0C, // CLEAR key
43 EK_RETURN = 0x0D, // ENTER key
44 EK_SHIFT = 0x10, // SHIFT key
45 EK_CONTROL = 0x11, // CTRL key
46 EK_MENU = 0x12, // ALT key
47 EK_PAUSE = 0x13, // PAUSE key
48 EK_CAPITAL = 0x14, // CAPS LOCK key
49 EK_KANA = 0x15, // IME Kana mode
50 EK_HANGUEL = 0x15, // IME Hanguel mode (maintained for compatibility use EK_HANGUL)
51 EK_HANGUL = 0x15, // IME Hangul mode
52 EK_JUNJA = 0x17, // IME Junja mode
53 EK_FINAL = 0x18, // IME final mode
54 EK_HANJA = 0x19, // IME Hanja mode
55 EK_KANJI = 0x19, // IME Kanji mode
56 EK_ESCAPE = 0x1B, // ESC key
57 EK_CONVERT = 0x1C, // IME convert
58 EK_NONCONVERT = 0x1D, // IME nonconvert
59 EK_ACCEPT = 0x1E, // IME accept
60 EK_MODECHANGE = 0x1F, // IME mode change request
61 EK_SPACE = 0x20, // SPACEBAR
62 EK_PRIOR = 0x21, // PAGE UP key
63 EK_NEXT = 0x22, // PAGE DOWN key
64 EK_END = 0x23, // END key
65 EK_HOME = 0x24, // HOME key
66 EK_LEFT = 0x25, // LEFT ARROW key
67 EK_UP = 0x26, // UP ARROW key
68 EK_RIGHT = 0x27, // RIGHT ARROW key
69 EK_DOWN = 0x28, // DOWN ARROW key
70 EK_SELECT = 0x29, // SELECT key
71 EK_PRINT = 0x2A, // PRINT key
72 EK_EXECUT = 0x2B, // EXECUTE key
73 EK_SNAPSHOT = 0x2C, // PRINT SCREEN key
74 EK_INSERT = 0x2D, // INS key
75 EK_DELETE = 0x2E, // DEL key
76 EK_HELP = 0x2F, // HELP key
77 EK_KEY_0 = 0x30, // 0 key
78 EK_KEY_1 = 0x31, // 1 key
79 EK_KEY_2 = 0x32, // 2 key
80 EK_KEY_3 = 0x33, // 3 key
81 EK_KEY_4 = 0x34, // 4 key
82 EK_KEY_5 = 0x35, // 5 key
83 EK_KEY_6 = 0x36, // 6 key
84 EK_KEY_7 = 0x37, // 7 key
85 EK_KEY_8 = 0x38, // 8 key
86 EK_KEY_9 = 0x39, // 9 key
87 EK_KEY_A = 0x41, // A key
88 EK_KEY_B = 0x42, // B key
89 EK_KEY_C = 0x43, // C key
90 EK_KEY_D = 0x44, // D key
91 EK_KEY_E = 0x45, // E key
92 EK_KEY_F = 0x46, // F key
93 EK_KEY_G = 0x47, // G key
94 EK_KEY_H = 0x48, // H key
95 EK_KEY_I = 0x49, // I key
96 EK_KEY_J = 0x4A, // J key
97 EK_KEY_K = 0x4B, // K key
98 EK_KEY_L = 0x4C, // L key
99 EK_KEY_M = 0x4D, // M key
100 EK_KEY_N = 0x4E, // N key
101 EK_KEY_O = 0x4F, // O key
102 EK_KEY_P = 0x50, // P key
103 EK_KEY_Q = 0x51, // Q key
104 EK_KEY_R = 0x52, // R key
105 EK_KEY_S = 0x53, // S key
106 EK_KEY_T = 0x54, // T key
107 EK_KEY_U = 0x55, // U key
108 EK_KEY_V = 0x56, // V key
109 EK_KEY_W = 0x57, // W key
110 EK_KEY_X = 0x58, // X key
111 EK_KEY_Y = 0x59, // Y key
112 EK_KEY_Z = 0x5A, // Z key
113 EK_LWIN = 0x5B, // Left Windows key (Microsoft Natural keyboard)
114 EK_RWIN = 0x5C, // Right Windows key (Natural keyboard)
115 EK_APPS = 0x5D, //Applications key (Natural keyboard)
116 EK_SLEEP = 0x5F, // Computer Sleep key
117 EK_NUMPAD0 = 0x60, // Numeric keypad 0 key
118 EK_NUMPAD1 = 0x61, // Numeric keypad 1 key
119 EK_NUMPAD2 = 0x62, // Numeric keypad 2 key
120 EK_NUMPAD3 = 0x63, // Numeric keypad 3 key
121 EK_NUMPAD4 = 0x64, // Numeric keypad 4 key
122 EK_NUMPAD5 = 0x65, // Numeric keypad 5 key
123 EK_NUMPAD6 = 0x66, // Numeric keypad 6 key
124 EK_NUMPAD7 = 0x67, // Numeric keypad 7 key
125 EK_NUMPAD8 = 0x68, // Numeric keypad 8 key
126 EK_NUMPAD9 = 0x69, // Numeric keypad 9 key
127 EK_MULTIPLY = 0x6A, // Multiply key
128 EK_ADD = 0x6B, // Add key
129 EK_SEPARATOR = 0x6C, // Separator key
130 EK_SUBTRACT = 0x6D, // Subtract key
131 EK_DECIMAL = 0x6E, // Decimal key
132 EK_DIVIDE = 0x6F, // Divide key
133 EK_F1 = 0x70, // F1 key
134 EK_F2 = 0x71, // F2 key
135 EK_F3 = 0x72, // F3 key
136 EK_F4 = 0x73, // F4 key
137 EK_F5 = 0x74, // F5 key
138 EK_F6 = 0x75, // F6 key
139 EK_F7 = 0x76, // F7 key
140 EK_F8 = 0x77, // F8 key
141 EK_F9 = 0x78, // F9 key
142 EK_F10 = 0x79, // F10 key
143 EK_F11 = 0x7A, // F11 key
144 EK_F12 = 0x7B, // F12 key
145 EK_F13 = 0x7C, // F13 key
146 EK_F14 = 0x7D, // F14 key
147 EK_F15 = 0x7E, // F15 key
148 EK_F16 = 0x7F, // F16 key
149 EK_F17 = 0x80, // F17 key
150 EK_F18 = 0x81, // F18 key
151 EK_F19 = 0x82, // F19 key
152 EK_F20 = 0x83, // F20 key
153 EK_F21 = 0x84, // F21 key
154 EK_F22 = 0x85, // F22 key
155 EK_F23 = 0x86, // F23 key
156 EK_F24 = 0x87, // F24 key
157 EK_NUMLOCK = 0x90, // NUM LOCK key
158 EK_SCROLL = 0x91, // SCROLL LOCK key
159 EK_LSHIFT = 0xA0, // Left SHIFT key
160 EK_RSHIFT = 0xA1, // Right SHIFT key
161 EK_LCONTROL = 0xA2, // Left CONTROL key
162 EK_RCONTROL = 0xA3, // Right CONTROL key
163 EK_LMENU = 0xA4, // Left MENU key
164 EK_RMENU = 0xA5, // Right MENU key
165 EK_PLUS = 0xBB, // Plus KEY (+)
166 EK_COMMA = 0xBC, // Comma KEY (,)
167 EK_MINUS = 0xBD, // Minus KEY (-)
168 EK_PERIOD = 0xBE, // Period KEY (.)
169 EK_ATTN = 0xF6, // Attn key
170 EK_CRSEL = 0xF7, // CrSel key
171 EK_EXSEL = 0xF8, // ExSel key
172 EK_EREOF = 0xF9, // Erase EOF key
173 EK_PLAY = 0xFA, // Play key
174 EK_ZOOM = 0xFB, // Zoom key
175 EK_PA1 = 0xFD, // PA1 key
176 EK_OEM_CLEAR = 0xFE, // Clear key
178 EK_COUNT = 0xFF // this is not a key, but the amount of keycodes there are.
181 //tolua_end
182 struct KeyName
184 Keycode code;
185 const char *name;
187 extern KeyName keynames[];
188 //tolua_begin
191 * \brief Translates a key name to a key code
193 Keycode getKey(std::string name);
195 //tolua_end
197 #endif