26 #include <OgreRenderWindow.h>
27 #include <OgreWindowEventUtilities.h>
29 #include <CEGUI/CEGUI.h>
31 #include <OIS/OISEvents.h>
32 #include <OIS/OISInputManager.h>
33 #include <OIS/OISKeyboard.h>
34 #include <OIS/OISMouse.h>
40 public OIS::KeyListener,
41 public OIS::MouseListener {
44 typedef std::pair<OIS::MouseButtonID, EventTrigger>
MouseKey;
56 typedef std::shared_ptr<EventListener>
shared;
67 void add_hook(MouseKey key,std::function<
void()> callback);
68 void add_hook(KeyBoardKey keystroke,
EventType type, std::function<
void()> callback);
74 bool mousePressed(
const OIS::MouseEvent& evt, OIS::MouseButtonID
id);
75 bool mouseReleased(
const OIS::MouseEvent& evt, OIS::MouseButtonID
id);
83 std::map<std::string, OIS::KeyCode>
keys_;
void windowClosed(Ogre::RenderWindow *window)
Definition: input.cpp:159
float x
Definition: input.h:59
void trigger_keyboard_events()
Definition: input.cpp:81
bool shutdown(void)
Definition: input.cpp:98
MouseKey mouse_key_
Definition: input.h:51
std::pair< OIS::KeyCode, EventTrigger > KeyBoardKey
Definition: input.h:45
CEGUI::MouseButton convertMouseButton(OIS::MouseButtonID id)
Definition: input.cpp:188
std::map< std::string, OIS::KeyCode > keys_
Definition: input.h:83
OIS::Mouse * mouse_
Definition: input.h:48
void create_input_manager(Ogre::RenderWindow *window)
Definition: input.cpp:164
bool keyPressed(const OIS::KeyEvent &arg)
Definition: input.cpp:111
OIS::Keyboard * keyboard_
Definition: input.h:49
OIS::InputManager * input_manager_
Definition: input.h:47
void capture(void)
Definition: input.cpp:58
KeyEvents events_
Definition: input.h:85
std::map< KeyBoardKey, std::function< void()> > repeat_triggers_
Definition: input.h:86
float y
Definition: input.h:59
void clear_hooks()
Definition: input.cpp:104
bool OnKeyPressed
Definition: input.h:43
bool keyReleased(const OIS::KeyEvent &arg)
Definition: input.cpp:123
void trigger_mouse_events()
Definition: input.cpp:73
void remove_key_from_buffer(KeyBoardKey event)
Definition: input.cpp:180
std::pair< OIS::MouseButtonID, EventTrigger > MouseKey
Definition: input.h:44
std::map< MouseKey, std::function< void()> > mouse_triggers_
Definition: input.h:53
std::vector< KeyBoardKey > KeyEvents
Definition: input.h:57
EventListener(Ogre::RenderWindow *window)
Definition: input.cpp:21
bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id)
Definition: input.cpp:140
std::map< KeyBoardKey, std::function< void()> > doitonce_triggers_
Definition: input.h:86
bool exit_
Definition: input.h:60
bool mouseMoved(const OIS::MouseEvent &evt)
Definition: input.cpp:134
std::shared_ptr< EventListener > shared
Definition: input.h:56
bool gui_shutdown(const CEGUI::EventArgs &event)
void add_hook(MouseKey key, std::function< void()> callback)
Definition: input.cpp:52
bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id)
Definition: input.cpp:151
void check_events()
Definition: input.cpp:64