Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ONE::util::InputManager Class Reference

Inheritance diagram for ONE::util::InputManager:

Inheritance graph
[legend]
List of all members.

Detailed Description

performs event conversion and dispatching

The manager processes events from the main loop and dispatches them to the engine subsystems and the application. Raw events are mapped to higher level CommandEvent s for that purpose. The Command association may be changed through the manager's input map.

Author:
Daniel Seibert


Public Types

typedef ControlListenerLPtr

Public Member Functions

void addControlListener (const LPtr &l)
bool appIgnoresStationary () const
bool appIgnoresUndefined () const
void dispatchKeyEvent (const SDL_KeyboardEvent &evt)
void dispatchMouseEvent (const int &x, const int &y, const int &rx, const int &ry, const unsigned int &b, SDLMod m=KMOD_NONE)
void dispatchMouseEvent (const SDL_MouseButtonEvent &evt, SDLMod m=KMOD_NONE)
 EventDispatcher ()
void fireEvent (ControlEvent &e) const
 notifies all registered listeners
InputMapgetInputMap ()
bool guiIgnoresStationary () const
bool isAppActive () const
bool isGuiActive () const
bool isMuted () const
 reflects this dispatcher's muted state.
void removeControlListener (const LPtr &l)
void setAppActive (bool muted)
void setAppIgnoresStationary (bool ignore)
void setAppIgnoresUndefined (bool ignore)
void setGuiActive (bool muted)
void setGuiIgnoresStationary (bool ignore)
void setMuted (bool mute)
 mutes or un-mutes the dispatcher

Static Public Member Functions

static void destroyInstance ()
 may be used to manually destroy the singleton instance
static InputManagergetInstance ()
 accesses the singleton instance
static bool isActive ()
 checks if the singleton is active
static bool isDestroyed ()
 checks if the singleton is destroyed
static bool isVirgin ()
 checks if the singleton has not been initialized
static void setPriority (unsigned short)
 sets this singleton's shutdown priority

Static Public Attributes

static const Command TOGGLE_CONSOLE

Protected Member Functions

void add (const LPtr &l)
 registers a listener
void remove (const LPtr &l)
 de-registers a listener.
 Singleton ()

Static Protected Member Functions

static void destroyedError ()
static void initInstance ()


Member Typedef Documentation

typedef ControlListener * ONE::util::EventDispatcher< ControlEvent , ControlListener , struct ControlRelay >::LPtr [inherited]
 


Member Function Documentation

void ONE::util::EventDispatcher< ControlEvent , ControlListener , struct ControlRelay >::add const LPtr l  )  [protected, inherited]
 

registers a listener

Parameters:
l a listener

void ONE::util::ControlDispatcher::addControlListener const LPtr l  )  [inline, inherited]
 

bool ONE::util::InputManager::appIgnoresStationary  )  const
 

bool ONE::util::InputManager::appIgnoresUndefined  )  const
 

static void ONE::util::OrderedAutomatic< InputManager >::destroyedError  )  [static, protected, inherited]
 

static void ONE::util::OrderedAutomatic< InputManager >::destroyInstance  )  [static, inherited]
 

may be used to manually destroy the singleton instance

If this function is not called, the instance is destroyed automatically during shutdown.

void ONE::util::InputManager::dispatchKeyEvent const SDL_KeyboardEvent &  evt  ) 
 

void ONE::util::InputManager::dispatchMouseEvent const int &  x,
const int &  y,
const int &  rx,
const int &  ry,
const unsigned int &  b,
SDLMod  m = KMOD_NONE
 

void ONE::util::InputManager::dispatchMouseEvent const SDL_MouseButtonEvent &  evt,
SDLMod  m = KMOD_NONE
 

ONE::util::EventDispatcher< ControlEvent , ControlListener , struct ControlRelay >::EventDispatcher  )  [inherited]
 

void ONE::util::EventDispatcher< ControlEvent , ControlListener , struct ControlRelay >::fireEvent ControlEvent e  )  const [inherited]
 

notifies all registered listeners

The listeners are called in the order in which they were added.
This function is provided primarily for use by subclasses. However, it may also be called from the outside in order to inject events into the system. Note that great care should be taken when doing so. For example, listeners generally rely on the event's source being identical to the instance that passes them around, i.e. this event dispatcher.

Parameters:
e the event to forward to each listener

InputMap* ONE::util::InputManager::getInputMap  ) 
 

static InputManager * ONE::util::Singleton< InputManager , OrderedAutomatic >::getInstance  )  [static, inherited]
 

accesses the singleton instance

The exact operation executed by calling this function is determined by the singleton policies.

Returns:
a pointer to the singleton instance

bool ONE::util::InputManager::guiIgnoresStationary  )  const
 

static void ONE::util::OrderedAutomatic< InputManager >::initInstance  )  [static, protected, inherited]
 

static bool ONE::util::Singleton< InputManager , OrderedAutomatic >::isActive  )  [static, inherited]
 

checks if the singleton is active

Returns:
if the singleton is instantiated

bool ONE::util::InputManager::isAppActive  )  const
 

static bool ONE::util::Singleton< InputManager , OrderedAutomatic >::isDestroyed  )  [static, inherited]
 

checks if the singleton is destroyed

This function returns true if an instance existed and was destroyed. Note that in some cases it is possible to revive a singleton.

Returns:
if the singleton is destroyed

bool ONE::util::InputManager::isGuiActive  )  const
 

bool ONE::util::EventDispatcher< ControlEvent , ControlListener , struct ControlRelay >::isMuted  )  const [inherited]
 

reflects this dispatcher's muted state.

Returns:
true if the dispatcher is muted, false otherwise

static bool ONE::util::Singleton< InputManager , OrderedAutomatic >::isVirgin  )  [static, inherited]
 

checks if the singleton has not been initialized

A singleton is not initialized if no instance exists and no instance has been destroyed.

Returns:
if the singleton is untouched

void ONE::util::EventDispatcher< ControlEvent , ControlListener , struct ControlRelay >::remove const LPtr l  )  [protected, inherited]
 

de-registers a listener.

This listener will no longer notify l of events, unless l is registered more than once. If so, a call to this function will only remove the first occurence of l.

Parameters:
l a listener

void ONE::util::ControlDispatcher::removeControlListener const LPtr l  )  [inline, inherited]
 

void ONE::util::InputManager::setAppActive bool  muted  ) 
 

void ONE::util::InputManager::setAppIgnoresStationary bool  ignore  ) 
 

void ONE::util::InputManager::setAppIgnoresUndefined bool  ignore  ) 
 

void ONE::util::InputManager::setGuiActive bool  muted  ) 
 

void ONE::util::InputManager::setGuiIgnoresStationary bool  ignore  ) 
 

void ONE::util::EventDispatcher< ControlEvent , ControlListener , struct ControlRelay >::setMuted bool  mute  )  [inherited]
 

mutes or un-mutes the dispatcher

Muted dispatchers no longer notify their listeners.

static void ONE::util::OrderedAutomatic< InputManager >::setPriority unsigned  short  )  [static, inherited]
 

sets this singleton's shutdown priority

The higher the priority, the earlier the instance will be destroyed during shutdown. If the priority is changed, the highest given priority will be used.

ONE::util::Singleton< InputManager , OrderedAutomatic >::Singleton  )  [protected, inherited]
 


Member Data Documentation

const Command ONE::util::InputManager::TOGGLE_CONSOLE [static]
 


Generated on Wed Sep 7 19:03:31 2005 for ONEngine by  doxygen 1.4.3