ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Common::EventManager Class Reference

The EventManager provides user input events to the client code. More...

#include <events.h>

Inheritance diagram for Common::EventManager:
Collaboration diagram for Common::EventManager:

List of all members.

Public Types

enum  { LBUTTON = 1 << 0, RBUTTON = 1 << 1 }
enum  { kEventManPriority = 0, kEventRecorderPriority = 1 }

Public Member Functions

 EventManager ()
virtual ~EventManager ()
virtual void init ()
 Initialize the event manager.
virtual bool pollEvent (Event &event)=0
 Get the next event in the event queue.
virtual void pushEvent (const Event &event)=0
 Pushes a "fake" event into the event queue.
virtual void purgeMouseEvents ()=0
 Purges all unprocessed mouse events already in the event queue.
virtual Point getMousePos () const =0
 Return the current mouse position.
virtual int getButtonState () const =0
 Return a bitmask with the button states:

  • bit 0: left button up=0, down=1
  • bit 1: right button up=0, down=1.

virtual int getModifierState () const =0
 Get a bitmask with the current modifier state.
virtual int shouldQuit () const =0
 Should the application terminate? Set to true if we received an EVENT_QUIT.
virtual int shouldRTL () const =0
 Should we return to the launcher?
virtual void resetRTL ()=0
 Reset the "return to launcher" flag (as returned shouldRTL()) to false.
EventDispatchergetEventDispatcher ()
 Returns the underlying EventDispatcher.

Protected Attributes

EventDispatcher _dispatcher

Detailed Description

The EventManager provides user input events to the client code.

In addition, it keeps track of the state of various input devices, like keys, mouse position and buttons.

Definition at line 443 of file common/events.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
LBUTTON 
RBUTTON 

Definition at line 448 of file common/events.h.

anonymous enum
Enumerator:
kEventManPriority 

Priority of the event manager, for now it's lowest since it eats *all* events, we might to change that in the future though.

kEventRecorderPriority 

Priority of the event recorder.

It has to go after event manager in order to record events generated by it

Definition at line 520 of file common/events.h.


Constructor & Destructor Documentation

Common::EventManager::EventManager (  )  [inline]

Definition at line 445 of file common/events.h.

virtual Common::EventManager::~EventManager (  )  [inline, virtual]

Definition at line 446 of file common/events.h.


Member Function Documentation

virtual int Common::EventManager::getButtonState (  )  const [pure virtual]

Return a bitmask with the button states:

  • bit 0: left button up=0, down=1
  • bit 1: right button up=0, down=1.

EventDispatcher* Common::EventManager::getEventDispatcher (  )  [inline]

Returns the underlying EventDispatcher.

Definition at line 536 of file common/events.h.

virtual int Common::EventManager::getModifierState (  )  const [pure virtual]

Get a bitmask with the current modifier state.

virtual Point Common::EventManager::getMousePos (  )  const [pure virtual]

Return the current mouse position.

virtual void Common::EventManager::init (  )  [inline, virtual]

Initialize the event manager.

Note:
called after graphics system has been set up

Definition at line 458 of file common/events.h.

virtual bool Common::EventManager::pollEvent ( Event event  )  [pure virtual]

Get the next event in the event queue.

Parameters:
event point to an Event struct, which will be filled with the event data.
Returns:
true if an event was retrieved.
virtual void Common::EventManager::purgeMouseEvents (  )  [pure virtual]

Purges all unprocessed mouse events already in the event queue.

virtual void Common::EventManager::pushEvent ( const Event event  )  [pure virtual]

Pushes a "fake" event into the event queue.

virtual void Common::EventManager::resetRTL (  )  [pure virtual]

Reset the "return to launcher" flag (as returned shouldRTL()) to false.

Used when we have returned to the launcher.

virtual int Common::EventManager::shouldQuit (  )  const [pure virtual]

Should the application terminate? Set to true if we received an EVENT_QUIT.

virtual int Common::EventManager::shouldRTL (  )  const [pure virtual]

Should we return to the launcher?


Member Data Documentation

Definition at line 539 of file common/events.h.


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


Generated on Sat Mar 23 2019 05:06:58 for ResidualVM by doxygen 1.7.1
curved edge   curved edge