Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::EventDispatcher Class Reference

Handles the Dispatching of events to a EventTarget (mainly a PositionTarget for mouse moving). More...

#include <OgreEventDispatcher.h>

List of all members.

Public Methods

 EventDispatcher (TargetManager *pTargetManager, EventProcessor *pEventProcessor)
virtual ~EventDispatcher ()
bool dispatchEvent (InputEvent *e)
 Dispatches an event to a PositionTarget if necessary, and returns whether or not the event was forwarded to a sub-PositionTarget. More...


Protected Methods

bool processMouseEvent (MouseEvent *e)
 This method attempts to distribute a mouse event to a lightweight PositionTarget. More...

void retargetMouseEvent (PositionTarget *target, int id, MouseEvent *e)
 Sends a mouse event to the current mouse event recipient using the given event (sent to the windowed host) as a srcEvent. More...

void setMouseTarget (PositionTarget *target, MouseEvent *e)
 Change the current target of mouse events. More...

void trackMouseEnterExit (PositionTarget *targetOver, MouseEvent *e)

Protected Attributes

TargetManagermTargetManager
EventProcessormEventProcessor
PositionTargetmFocus
 The current PositionTarget that has focus that is being hosted by this GuiContainer. More...

PositionTargetmMousePositionTarget
 The current PositionTarget being hosted by this windowed PositionTarget that has mouse events being forwarded to it. More...

PositionTargetmCursorOn
 PositionTarget the cursor is on. More...

PositionTargetmTargetLastEntered
 The last PositionTarget entered. More...

bool mDragging
 Indicates if the mouse pointer is currently being dragged... More...

int mEventMask


Detailed Description

Handles the Dispatching of events to a EventTarget (mainly a PositionTarget for mouse moving).

Remarks:
A EventDispatcher is needed for each TargetManager. ie 1 dispatcher for the OverlayManager, for managing the 2D GUI components, and another EventDispatcher for a SceneManager managing the 3D objects.(NOTE currently the SceneManager isn't a TargetManager.. this is a TODO).


Constructor & Destructor Documentation

Ogre::EventDispatcher::EventDispatcher TargetManager   pTargetManager,
EventProcessor   pEventProcessor
 

Ogre::EventDispatcher::~EventDispatcher   [virtual]
 


Member Function Documentation

bool Ogre::EventDispatcher::dispatchEvent InputEvent   e
 

Dispatches an event to a PositionTarget if necessary, and returns whether or not the event was forwarded to a sub-PositionTarget.

Parameters:
e  the event

bool Ogre::EventDispatcher::processMouseEvent MouseEvent   e [protected]
 

This method attempts to distribute a mouse event to a lightweight PositionTarget.

It tries to avoid doing any unnecessary probes down into the PositionTarget tree to minimize the overhead of determining where to route the event, since mouse movement events tend to come in large and frequent amounts.

void Ogre::EventDispatcher::retargetMouseEvent PositionTarget   target,
int    id,
MouseEvent   e
[protected]
 

Sends a mouse event to the current mouse event recipient using the given event (sent to the windowed host) as a srcEvent.

If the mouse event target is still in the PositionTarget tree, the coordinates of the event are translated to those of the target. If the target has been removed, we don't bother to send the message.

void Ogre::EventDispatcher::setMouseTarget PositionTarget   target,
MouseEvent   e
[protected]
 

Change the current target of mouse events.

the only place that modifies the member var mMousePositionTarget

void Ogre::EventDispatcher::trackMouseEnterExit PositionTarget   targetOver,
MouseEvent   e
[protected]
 


Member Data Documentation

PositionTarget* Ogre::EventDispatcher::mCursorOn [protected]
 

PositionTarget the cursor is on.

bool Ogre::EventDispatcher::mDragging [protected]
 

Indicates if the mouse pointer is currently being dragged...

this is needed because we may receive exit events while dragging and need to keep the current mouse target in this case.

int Ogre::EventDispatcher::mEventMask [protected]
 

EventProcessor* Ogre::EventDispatcher::mEventProcessor [protected]
 

PositionTarget* Ogre::EventDispatcher::mFocus [protected]
 

The current PositionTarget that has focus that is being hosted by this GuiContainer.

If this is a null reference then there is currently no focus on a PositionTarget being hosted by this GuiContainer

PositionTarget* Ogre::EventDispatcher::mMousePositionTarget [protected]
 

The current PositionTarget being hosted by this windowed PositionTarget that has mouse events being forwarded to it.

If this is null, there are currently no mouse events being forwarded to a PositionTarget.

PositionTarget* Ogre::EventDispatcher::mTargetLastEntered [protected]
 

The last PositionTarget entered.

TargetManager* Ogre::EventDispatcher::mTargetManager [protected]
 

Copyright © 2002 by The OGRE Team