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