ScummVM API documentation
Common::EventManager Class Referenceabstract

#include <events.h>

Inheritance diagram for Common::EventManager:
Common::NonCopyable DefaultEventManager

Public Types

enum  { LBUTTON = 1 << MOUSE_BUTTON_LEFT, RBUTTON = 1 << MOUSE_BUTTON_RIGHT }
 
enum  { kEventManPriority = 0, kEventRecorderPriority = 1, kEventRemapperPriority = 999 }
 

Public Member Functions

virtual void init ()
 
virtual bool pollEvent (Event &event)=0
 
virtual void pushEvent (const Event &event)=0
 
virtual void purgeMouseEvents ()=0
 
virtual void purgeKeyboardEvents ()=0
 
virtual Point getMousePos () const =0
 
virtual int getButtonState () const =0
 
virtual int getModifierState () const =0
 
virtual int shouldQuit () const =0
 
virtual int shouldReturnToLauncher () const =0
 
virtual void resetReturnToLauncher ()=0
 
virtual void resetQuit ()=0
 
virtual KeymappergetKeymapper ()=0
 
virtual KeymapgetGlobalKeymap ()=0
 
EventDispatchergetEventDispatcher ()
 

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.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kEventManPriority 

Priority of the event manager. For now, it is lowest since it eats all events. This might be changed in the future though.

kEventRecorderPriority 

Priority of the event recorder. It must go after the event manager in order to record events generated by it.

kEventRemapperPriority 

Priority of the remap dialog. It must go first to capture all the events before they are consumed by other observers.

Member Function Documentation

◆ init()

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

Initialize the event manager.

Note
Called after graphics system has been set up.

Reimplemented in DefaultEventManager.

◆ 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.
Return values
trueIf an event was retrieved.

Implemented in DefaultEventManager.

◆ pushEvent()

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

Push a "fake" event into the event queue.

Implemented in DefaultEventManager.

◆ purgeMouseEvents()

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

Purge all unprocessed mouse events already in the event queue.

Implemented in DefaultEventManager.

◆ purgeKeyboardEvents()

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

Purge all unprocessed keyboard events already in the event queue.

Implemented in DefaultEventManager.

◆ getMousePos()

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

Return the current mouse position.

Implemented in DefaultEventManager.

◆ 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.

◆ getModifierState()

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

Get a bitmask with the current modifier state.

Implemented in DefaultEventManager.

◆ shouldQuit()

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

Whether the application should terminate. Set to true if EVENT_QUIT was received.

Implemented in DefaultEventManager.

◆ shouldReturnToLauncher()

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

Whether to return to the launcher.

Implemented in DefaultEventManager.

◆ resetReturnToLauncher()

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

Reset the "return to launcher" flag (as returned shouldReturnToLauncher()) to false. Used when we have returned to the launcher.

Implemented in DefaultEventManager.

◆ getKeymapper()

virtual Keymapper* Common::EventManager::getKeymapper ( )
pure virtual

Return the Keymapper object.

Implemented in DefaultEventManager.

◆ getGlobalKeymap()

virtual Keymap* Common::EventManager::getGlobalKeymap ( )
pure virtual

Return the global Keymap object.

Implemented in DefaultEventManager.

◆ getEventDispatcher()

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

Return the underlying EventDispatcher.


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