Tinman  1.0
Public Types | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
EventListener Class Reference

#include <input.h>

Inheritance diagram for EventListener:
Inheritance graph
[legend]
Collaboration diagram for EventListener:
Collaboration graph
[legend]

Public Types

typedef std::shared_ptr< EventListenershared
 
typedef std::vector< KeyBoardKeyKeyEvents
 

Public Member Functions

 EventListener (Ogre::RenderWindow *window)
 
void capture (void)
 
void check_events ()
 
void add_hook (MouseKey key, std::function< void()> callback)
 
void add_hook (KeyBoardKey keystroke, EventType type, std::function< void()> callback)
 
void clear_hooks ()
 
bool keyPressed (const OIS::KeyEvent &arg)
 
bool keyReleased (const OIS::KeyEvent &arg)
 
bool mouseMoved (const OIS::MouseEvent &evt)
 
bool mousePressed (const OIS::MouseEvent &evt, OIS::MouseButtonID id)
 
bool mouseReleased (const OIS::MouseEvent &evt, OIS::MouseButtonID id)
 
void windowClosed (Ogre::RenderWindow *window)
 
bool shutdown (void)
 
bool gui_shutdown (const CEGUI::EventArgs &event)
 

Public Attributes

float x
 
float y
 
bool exit_
 

Private Types

typedef bool OnKeyPressed
 
typedef std::pair< OIS::MouseButtonID, EventTriggerMouseKey
 
typedef std::pair< OIS::KeyCode, EventTriggerKeyBoardKey
 

Private Member Functions

void create_input_manager (Ogre::RenderWindow *window)
 
void remove_key_from_buffer (KeyBoardKey event)
 
void trigger_keyboard_events ()
 
void trigger_mouse_events ()
 
CEGUI::MouseButton convertMouseButton (OIS::MouseButtonID id)
 

Private Attributes

OIS::InputManager * input_manager_
 
OIS::Mouse * mouse_
 
OIS::Keyboard * keyboard_
 
MouseKey mouse_key_
 
std::map< MouseKey, std::function< void()> > mouse_triggers_
 
std::map< std::string, OIS::KeyCode > keys_
 
KeyEvents events_
 
std::map< KeyBoardKey, std::function< void()> > repeat_triggers_
 
std::map< KeyBoardKey, std::function< void()> > doitonce_triggers_
 

Member Typedef Documentation

typedef std::pair<OIS::KeyCode, EventTrigger> EventListener::KeyBoardKey
private
typedef std::vector<KeyBoardKey> EventListener::KeyEvents
typedef std::pair<OIS::MouseButtonID, EventTrigger> EventListener::MouseKey
private
typedef bool EventListener::OnKeyPressed
private
typedef std::shared_ptr<EventListener> EventListener::shared

Constructor & Destructor Documentation

EventListener::EventListener ( Ogre::RenderWindow *  window)

Member Function Documentation

void EventListener::add_hook ( MouseKey  key,
std::function< void()>  callback 
)
void EventListener::add_hook ( EventListener::KeyBoardKey  keystroke,
EventType  type,
std::function< void()>  callback 
)
void EventListener::capture ( void  )
void EventListener::check_events ( void  )
void EventListener::clear_hooks ( )
CEGUI::MouseButton EventListener::convertMouseButton ( OIS::MouseButtonID  id)
private
void EventListener::create_input_manager ( Ogre::RenderWindow *  window)
private
bool EventListener::gui_shutdown ( const CEGUI::EventArgs &  event)
bool EventListener::keyPressed ( const OIS::KeyEvent &  arg)
bool EventListener::keyReleased ( const OIS::KeyEvent &  arg)
bool EventListener::mouseMoved ( const OIS::MouseEvent &  evt)
bool EventListener::mousePressed ( const OIS::MouseEvent &  evt,
OIS::MouseButtonID  id 
)
bool EventListener::mouseReleased ( const OIS::MouseEvent &  evt,
OIS::MouseButtonID  id 
)
void EventListener::remove_key_from_buffer ( KeyBoardKey  event)
private
bool EventListener::shutdown ( void  )
void EventListener::trigger_keyboard_events ( )
private
void EventListener::trigger_mouse_events ( )
private
void EventListener::windowClosed ( Ogre::RenderWindow *  window)

Member Data Documentation

std::map<KeyBoardKey, std::function<void()> > EventListener::doitonce_triggers_
private
KeyEvents EventListener::events_
private
bool EventListener::exit_
OIS::InputManager* EventListener::input_manager_
private
OIS::Keyboard* EventListener::keyboard_
private
std::map<std::string, OIS::KeyCode> EventListener::keys_
private
OIS::Mouse* EventListener::mouse_
private
MouseKey EventListener::mouse_key_
private
std::map<MouseKey, std::function<void()> > EventListener::mouse_triggers_
private
std::map<KeyBoardKey, std::function<void()> > EventListener::repeat_triggers_
private
float EventListener::x
float EventListener::y

The documentation for this class was generated from the following files: