28 #ifndef CCEGUIEVENTPUSHER_H_INCLUDED
29 #define CCEGUIEVENTPUSHER_H_INCLUDED
31 #include "../../CEGUI.h"
40 gui::ICursorControl* d_cursorctrl;
51 bool OnEvent(
const SEvent& event)
53 switch (event.EventType)
55 case EET_KEY_INPUT_EVENT :
56 if (event.KeyInput.PressedDown)
57 return OnKeyDown(event.KeyInput.Key, event.KeyInput.Char, event.KeyInput.Control, event.KeyInput.Shift);
59 return OnKeyUp(event.KeyInput.Key, event.KeyInput.Char, event.KeyInput.Control, event.KeyInput.Shift);
62 case EET_MOUSE_INPUT_EVENT :
63 return OnMouse(event.MouseInput.X, event.MouseInput.Y, event.MouseInput.Wheel, event.MouseInput.Event);
73 bool OnKeyDown(EKEY_CODE key,
wchar_t wch,
bool ,
bool )
82 bool OnKeyUp(EKEY_CODE key,
wchar_t ,
bool ,
bool )
90 bool OnMouse(s32 x, s32 y, f32 w, EMOUSE_INPUT_EVENT e)
98 case EMIE_LMOUSE_PRESSED_DOWN:
102 case EMIE_RMOUSE_PRESSED_DOWN:
106 case EMIE_MMOUSE_PRESSED_DOWN:
110 case EMIE_LMOUSE_LEFT_UP:
114 case EMIE_RMOUSE_LEFT_UP:
118 case EMIE_MMOUSE_LEFT_UP:
122 case EMIE_MOUSE_MOVED:
124 static_cast<float>(x), static_cast<float>(y));
128 case EMIE_MOUSE_WHEEL:
145 CEGUI::Key::Scan getKeyCode(irr::EKEY_CODE kc)
const
147 return irr2ceCODE[kc];
151 CEGUI::Key::Scan irr2ceCODE[irr::KEY_KEY_CODES_COUNT];
156 memset(irr2ceCODE, Key::Unknown, KEY_KEY_CODES_COUNT);
158 irr2ceCODE[KEY_LBUTTON ] = Key::Unknown;
159 irr2ceCODE[KEY_RBUTTON ] = Key::Unknown;
160 irr2ceCODE[KEY_CANCEL ] = Key::Unknown;
161 irr2ceCODE[KEY_MBUTTON ] = Key::Unknown;
162 irr2ceCODE[KEY_XBUTTON1 ] = Key::Unknown;
163 irr2ceCODE[KEY_XBUTTON2 ] = Key::Unknown;
164 irr2ceCODE[KEY_BACK ] = Key::Backspace;
165 irr2ceCODE[KEY_TAB ] = Key::Tab;
166 irr2ceCODE[KEY_CLEAR ] = Key::Unknown;
167 irr2ceCODE[KEY_RETURN ] = Key::Return;
168 irr2ceCODE[KEY_SHIFT ] = Key::LeftShift;
169 irr2ceCODE[KEY_CONTROL ] = Key::LeftControl;
170 irr2ceCODE[KEY_MENU ] = Key::LeftAlt;
171 irr2ceCODE[KEY_PAUSE ] = Key::Pause;
172 irr2ceCODE[KEY_CAPITAL ] = Key::Capital;
173 irr2ceCODE[KEY_KANA ] = Key::Kana;
174 irr2ceCODE[KEY_HANGUEL ] = Key::Unknown;
175 irr2ceCODE[KEY_HANGUL ] = Key::Unknown;
176 irr2ceCODE[KEY_JUNJA ] = Key::Unknown;
177 irr2ceCODE[KEY_FINAL ] = Key::Unknown;
178 irr2ceCODE[KEY_HANJA ] = Key::Unknown;
179 irr2ceCODE[KEY_KANJI ] = Key::Unknown;
180 irr2ceCODE[KEY_ESCAPE ] = Key::Escape;
181 irr2ceCODE[KEY_CONVERT ] = Key::Convert;
182 irr2ceCODE[KEY_NONCONVERT] = Key::NoConvert;
183 irr2ceCODE[KEY_ACCEPT ] = Key::Unknown;
184 irr2ceCODE[KEY_MODECHANGE] = Key::Unknown;
185 irr2ceCODE[KEY_SPACE ] = Key::Space;
186 irr2ceCODE[KEY_PRIOR ] = Key::PageUp;
187 irr2ceCODE[KEY_NEXT ] = Key::PageDown;
188 irr2ceCODE[KEY_END ] = Key::End;
189 irr2ceCODE[KEY_HOME ] = Key::Home;
190 irr2ceCODE[KEY_LEFT ] = Key::ArrowLeft;
191 irr2ceCODE[KEY_UP ] = Key::ArrowUp;
192 irr2ceCODE[KEY_RIGHT ] = Key::ArrowRight;
193 irr2ceCODE[KEY_DOWN ] = Key::ArrowDown;
194 irr2ceCODE[KEY_SELECT ] = Key::Unknown;
195 irr2ceCODE[KEY_PRINT ] = Key::SysRq;
196 irr2ceCODE[KEY_EXECUT ] = Key::Unknown;
197 irr2ceCODE[KEY_SNAPSHOT ] = Key::Unknown;
198 irr2ceCODE[KEY_INSERT ] = Key::Insert;
199 irr2ceCODE[KEY_DELETE ] = Key::Delete;
200 irr2ceCODE[KEY_HELP ] = Key::Unknown;
201 irr2ceCODE[KEY_KEY_0 ] = Key::Zero;
202 irr2ceCODE[KEY_KEY_1 ] = Key::One;
203 irr2ceCODE[KEY_KEY_2 ] = Key::Two;
204 irr2ceCODE[KEY_KEY_3 ] = Key::Three;
205 irr2ceCODE[KEY_KEY_4 ] = Key::Four;
206 irr2ceCODE[KEY_KEY_5 ] = Key::Five;
207 irr2ceCODE[KEY_KEY_6 ] = Key::Six;
208 irr2ceCODE[KEY_KEY_7 ] = Key::Seven;
209 irr2ceCODE[KEY_KEY_8 ] = Key::Eight;
210 irr2ceCODE[KEY_KEY_9 ] = Key::Nine;
211 irr2ceCODE[KEY_KEY_A ] = Key::A;
212 irr2ceCODE[KEY_KEY_B ] = Key::B;
213 irr2ceCODE[KEY_KEY_C ] = Key::C;
214 irr2ceCODE[KEY_KEY_D ] = Key::D;
215 irr2ceCODE[KEY_KEY_E ] = Key::E;
216 irr2ceCODE[KEY_KEY_F ] = Key::F;
217 irr2ceCODE[KEY_KEY_G ] = Key::G;
218 irr2ceCODE[KEY_KEY_H ] = Key::H;
219 irr2ceCODE[KEY_KEY_I ] = Key::I;
220 irr2ceCODE[KEY_KEY_J ] = Key::J;
221 irr2ceCODE[KEY_KEY_K ] = Key::K;
222 irr2ceCODE[KEY_KEY_L ] = Key::L;
223 irr2ceCODE[KEY_KEY_M ] = Key::M;
224 irr2ceCODE[KEY_KEY_N ] = Key::N;
225 irr2ceCODE[KEY_KEY_O ] = Key::O;
226 irr2ceCODE[KEY_KEY_P ] = Key::P;
227 irr2ceCODE[KEY_KEY_Q ] = Key::Q;
228 irr2ceCODE[KEY_KEY_R ] = Key::R;
229 irr2ceCODE[KEY_KEY_S ] = Key::S;
230 irr2ceCODE[KEY_KEY_T ] = Key::T;
231 irr2ceCODE[KEY_KEY_U ] = Key::U;
232 irr2ceCODE[KEY_KEY_V ] = Key::V;
233 irr2ceCODE[KEY_KEY_W ] = Key::W;
234 irr2ceCODE[KEY_KEY_X ] = Key::X;
235 irr2ceCODE[KEY_KEY_Y ] = Key::Y;
236 irr2ceCODE[KEY_KEY_Z ] = Key::Z;
237 irr2ceCODE[KEY_LWIN ] = Key::LeftWindows;
238 irr2ceCODE[KEY_RWIN ] = Key::RightWindows;
239 irr2ceCODE[KEY_APPS ] = Key::AppMenu;
240 irr2ceCODE[KEY_SLEEP ] = Key::Sleep;
241 irr2ceCODE[KEY_NUMPAD0 ] = Key::Numpad0;
242 irr2ceCODE[KEY_NUMPAD1 ] = Key::Numpad1;
243 irr2ceCODE[KEY_NUMPAD2 ] = Key::Numpad2;
244 irr2ceCODE[KEY_NUMPAD3 ] = Key::Numpad3;
245 irr2ceCODE[KEY_NUMPAD4 ] = Key::Numpad4;
246 irr2ceCODE[KEY_NUMPAD5 ] = Key::Numpad5;
247 irr2ceCODE[KEY_NUMPAD6 ] = Key::Numpad6;
248 irr2ceCODE[KEY_NUMPAD7 ] = Key::Numpad7;
249 irr2ceCODE[KEY_NUMPAD8 ] = Key::Numpad8;
250 irr2ceCODE[KEY_NUMPAD9 ] = Key::Numpad9;
251 irr2ceCODE[KEY_MULTIPLY ] = Key::Multiply;
252 irr2ceCODE[KEY_ADD ] = Key::Add;
253 irr2ceCODE[KEY_SEPARATOR ] = Key::Unknown;
254 irr2ceCODE[KEY_SUBTRACT ] = Key::Subtract;
255 irr2ceCODE[KEY_DECIMAL ] = Key::Decimal;
256 irr2ceCODE[KEY_DIVIDE ] = Key::Divide;
257 irr2ceCODE[KEY_F1 ] = Key::F1;
258 irr2ceCODE[KEY_F2 ] = Key::F2;
259 irr2ceCODE[KEY_F3 ] = Key::F3;
260 irr2ceCODE[KEY_F4 ] = Key::F4;
261 irr2ceCODE[KEY_F5 ] = Key::F5;
262 irr2ceCODE[KEY_F6 ] = Key::F6;
263 irr2ceCODE[KEY_F7 ] = Key::F7;
264 irr2ceCODE[KEY_F8 ] = Key::F8;
265 irr2ceCODE[KEY_F9 ] = Key::F9;
266 irr2ceCODE[KEY_F10 ] = Key::F10;
267 irr2ceCODE[KEY_F11 ] = Key::F11;
268 irr2ceCODE[KEY_F12 ] = Key::F12;
269 irr2ceCODE[KEY_F13 ] = Key::F13;
270 irr2ceCODE[KEY_F14 ] = Key::F14;
271 irr2ceCODE[KEY_F15 ] = Key::F15;
272 irr2ceCODE[KEY_F16 ] = Key::Unknown;
273 irr2ceCODE[KEY_F17 ] = Key::Unknown;
274 irr2ceCODE[KEY_F18 ] = Key::Unknown;
275 irr2ceCODE[KEY_F19 ] = Key::Unknown;
276 irr2ceCODE[KEY_F20 ] = Key::Unknown;
277 irr2ceCODE[KEY_F21 ] = Key::Unknown;
278 irr2ceCODE[KEY_F22 ] = Key::Unknown;
279 irr2ceCODE[KEY_F23 ] = Key::Unknown;
280 irr2ceCODE[KEY_F24 ] = Key::Unknown;
281 irr2ceCODE[KEY_NUMLOCK ] = Key::NumLock;
282 irr2ceCODE[KEY_SCROLL ] = Key::ScrollLock;
283 irr2ceCODE[KEY_LSHIFT ] = Key::LeftShift;
284 irr2ceCODE[KEY_RSHIFT ] = Key::RightShift;
285 irr2ceCODE[KEY_LCONTROL ] = Key::LeftControl;
286 irr2ceCODE[KEY_RCONTROL ] = Key::RightControl;
287 irr2ceCODE[KEY_LMENU ] = Key::LeftAlt;
288 irr2ceCODE[KEY_RMENU ] = Key::RightAlt;
289 irr2ceCODE[KEY_COMMA ] = Key::Comma;
290 irr2ceCODE[KEY_PLUS ] = Key::Add;
291 irr2ceCODE[KEY_MINUS ] = Key::Minus;
292 irr2ceCODE[KEY_PERIOD ] = Key::Period;
293 irr2ceCODE[KEY_ATTN ] = Key::Unknown;
294 irr2ceCODE[KEY_CRSEL ] = Key::Unknown;
295 irr2ceCODE[KEY_EXSEL ] = Key::Unknown;
296 irr2ceCODE[KEY_EREOF ] = Key::Unknown;
297 irr2ceCODE[KEY_PLAY ] = Key::Unknown;
298 irr2ceCODE[KEY_ZOOM ] = Key::Unknown;
299 irr2ceCODE[KEY_PA1 ] = Key::Unknown;
300 irr2ceCODE[KEY_OEM_CLEAR ] = Key::Unknown;