ScummVM
Common::EventManager Class Referenceabstract

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

#include <events.h>

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

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. More...
 
virtual bool pollEvent (Event &event)=0
 Get the next event in the event queue. More...
 
virtual void pushEvent (const Event &event)=0
 Pushes a "fake" event into the event queue. More...
 
virtual void purgeMouseEvents ()=0
 Purges all unprocessed mouse events already in the event queue. More...
 
virtual Point getMousePos () const =0
 Return the current mouse position. More...
 
virtual int getButtonState () const =0
 Return a bitmask with the button states: More...
 
virtual int getModifierState () const =0
 Get a bitmask with the current modifier state. More...
 
virtual int shouldQuit () const =0
 Should the application terminate? Set to true if we received an EVENT_QUIT. More...
 
virtual int shouldRTL () const =0
 Should we return to the launcher? More...
 
virtual void resetRTL ()=0
 Reset the "return to launcher" flag (as returned shouldRTL()) to false. More...
 
EventDispatchergetEventDispatcher ()
 Returns the underlying EventDispatcher. More...
 

Protected Attributes

EventDispatcher _dispatcher
 

Additional Inherited Members

- Private Member Functions inherited from Common::NonCopyable
 NonCopyable ()
 

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 435 of file events.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
LBUTTON 
RBUTTON 

Definition at line 440 of file events.h.

◆ anonymous enum

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 512 of file events.h.

Constructor & Destructor Documentation

◆ EventManager()

Common::EventManager::EventManager ( )
inline

Definition at line 437 of file events.h.

◆ ~EventManager()

virtual Common::EventManager::~EventManager ( )
inlinevirtual

Definition at line 438 of file events.h.

Member Function Documentation

◆ getButtonState()

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

Implemented in DefaultEventManager.

◆ getEventDispatcher()

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

Returns the underlying EventDispatcher.

Definition at line 528 of file events.h.

◆ getModifierState()

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

Get a bitmask with the current modifier state.

Implemented in DefaultEventManager.

◆ getMousePos()

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

Return the current mouse position.

Implemented in DefaultEventManager.

◆ init()

virtual void Common::EventManager::init ( void  )
inlinevirtual

Initialize the event manager.

Note
called after graphics system has been set up

Reimplemented in TizenEventManager, and DefaultEventManager.

Definition at line 450 of file events.h.

◆ pollEvent()

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

Get the next event in the event queue.

Parameters
eventpoint to an Event struct, which will be filled with the event data.
Returns
true if an event was retrieved.

Implemented in DefaultEventManager.

◆ purgeMouseEvents()

virtual void Common::EventManager::purgeMouseEvents ( )
pure virtual

Purges all unprocessed mouse events already in the event queue.

Implemented in DefaultEventManager.

◆ pushEvent()

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

Pushes a "fake" event into the event queue.

Implemented in DefaultEventManager.

◆ resetRTL()

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.

Implemented in DefaultEventManager.

◆ shouldQuit()

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

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

Implemented in TizenEventManager, and DefaultEventManager.

◆ shouldRTL()

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

Should we return to the launcher?

Implemented in DefaultEventManager.

Member Data Documentation

◆ _dispatcher

EventDispatcher Common::EventManager::_dispatcher
protected

Definition at line 531 of file events.h.


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