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

# Ogre::InputEvent Class Reference

The root event class for all GuiElement-level input events. More...

`#include <OgreInputEvent.h>`

Inheritance diagram for Ogre::InputEvent:

[legend]
List of all members.

## Public Types

enum | { SHIFT_MASK = 1 << 0, CTRL_MASK = 1 << 1, META_MASK = 1 << 2, ALT_MASK = 1 << 3, BUTTON0_MASK = 1 << 4, BUTTON1_MASK = 1 << 5, BUTTON2_MASK = 1 << 6, BUTTON3_MASK = 1 << 7, BUTTON_ANY_MASK = 0xF << 4 }

## Public Methods

| InputEvent (EventTarget *source, int id, long when, int modifiers)
| Constructs an InputEvent object with the specified source GuiElement, modifiers, and type.
void | consume ()
| Consumes this event so that it will not be processed in the default manner by the source which originated it.
int | getModifiers () const
| Returns the modifiers flag for this event.
Real | getWhen () const
| Returns the timestamp of when this event occurred.
bool | isAltDown () const
| Returns whether or not the Alt modifier is down on this event.
bool | isConsumed () const
| Returns whether or not this event has been consumed.
bool | isControlDown () const
| Returns whether or not the Control modifier is down on this event.
bool | isMetaDown () const
| Returns whether or not the Meta modifier is down on this event.
bool | isShiftDown () const
| Returns whether or not the Shift modifier is down on this event.
bool | isEventBetween (int start, int end) const
int | getID () const
EventTarget * | getSource () const

## Protected Attributes

Real | mWhen
| Not implemented yet.
int | mModifiers
| The state of the modifier keys at the time the input event was fired.
EventTarget * | mSource
| The target to process the event.
int | mId
| The ID of the event.
bool | mConsumed
| whether the event has been consumed

## Detailed Description

The root event class for all GuiElement-level input events.

Remarks:
  Input events are delivered to listeners before they are processed normally by the source where they originated. This allows listeners and GuiElement subclasses to "consume" the event so that the source will not process them in their default manner. For example, consuming mousePressed events on a Button GuiElement will prevent the Button from being activated.

Definition at line 60 of file OgreInputEvent.h.

## Member Enumeration Documentation

anonymous enum

Enumeration values:

  SHIFT_MASK | This flag indicates that the Shift key was down when the event occurred.
  CTRL_MASK | This flag indicates that the Control key was down when the event occurred.
  META_MASK | This flag indicates that the Meta key was down when the event occurred. For mouse events, this flag indicates that the right button was pressed or released.
  ALT_MASK | This flag indicates that the Alt key was down when the event occurred. For mouse events, this flag indicates that the middle mouse button was pressed or released.
  BUTTON0_MASK |
  BUTTON1_MASK |
  BUTTON2_MASK |
  BUTTON3_MASK |
  BUTTON_ANY_MASK |

Definition at line 93 of file OgreInputEvent.h.

## Constructor & Destructor Documentation

Ogre::InputEvent::InputEvent | ( | EventTarget * | source,
|  | int | id,
|  | long | when,
|  | int | modifiers
| ) |

Constructs an InputEvent object with the specified source GuiElement, modifiers, and type.

Parameters:

  source | the object where the event originated @id the event type @when the time the event occurred @modifiers the modifier keys down while event occurred

Definition at line 33 of file OgreInputEvent.cpp.

References mConsumed.

## Member Function Documentation

void Ogre::InputEvent::consume | ( |  | ) |

| Consumes this event so that it will not be processed in the default manner by the source which originated it. Definition at line 43 of file OgreInputEvent.cpp. References mConsumed. Referenced by Ogre::EventDispatcher::retargetMouseEvent().

int Ogre::InputEvent::getID | ( |  | ) | const

Definition at line 89 of file OgreInputEvent.cpp.

References mId.

Referenced by Ogre::ActionTarget::processActionEvent(), Ogre::TextBoxGuiElement::processEvent(), Ogre::ScrollBarGuiElement::processEvent(), Ogre::OverlayManager::processEvent(), Ogre::GuiElement::processEvent(), Ogre::GuiControl::processEvent(), Ogre::EventProcessor::processEvent(), Ogre::Cursor::processEvent(), Ogre::KeyTarget::processKeyEvent(), Ogre::MouseTarget::processMouseEvent(), Ogre::EventDispatcher::processMouseEvent(), Ogre::MouseMotionTarget::processMouseMotionEvent(), Ogre::ScrollTarget::processScrollEvent(), and Ogre::EventDispatcher::retargetMouseEvent().

int Ogre::InputEvent::getModifiers | ( |  | ) | const

| Returns the modifiers flag for this event. Definition at line 48 of file OgreInputEvent.cpp. References mModifiers. Referenced by Ogre::MouseEvent::paramString(), Ogre::EventDispatcher::retargetKeyEvent(), and Ogre::EventDispatcher::retargetMouseEvent().

EventTarget * Ogre::InputEvent::getSource | ( |  | ) | const

| Definition at line 95 of file OgreInputEvent.cpp. References mSource. Referenced by Ogre::ScrollBarGuiElement::mousePressed(), and Ogre::ListGuiElement::mousePressed().

Real Ogre::InputEvent::getWhen | ( |  | ) | const

| Returns the timestamp of when this event occurred. Not implemented yet Definition at line 53 of file OgreInputEvent.cpp. References mWhen, and Ogre::Real. Referenced by Ogre::EventDispatcher::retargetKeyEvent(), and Ogre::EventDispatcher::retargetMouseEvent().

bool Ogre::InputEvent::isAltDown | ( |  | ) | const

| Returns whether or not the Alt modifier is down on this event. Definition at line 58 of file OgreInputEvent.cpp. References mModifiers.

bool Ogre::InputEvent::isConsumed | ( |  | ) | const

Returns whether or not this event has been consumed.

See also:
  consume

Definition at line 63 of file OgreInputEvent.cpp.

References mConsumed.

Referenced by Ogre::TextBoxGuiElement::processEvent(), Ogre::ScrollBarGuiElement::processEvent(), Ogre::GuiElement::processEvent(), Ogre::GuiControl::processEvent(), Ogre::EventProcessor::processEvent(), Ogre::EventDispatcher::processKeyEvent(), and Ogre::EventDispatcher::processMouseEvent().

bool Ogre::InputEvent::isControlDown | ( |  | ) | const

| Returns whether or not the Control modifier is down on this event. Definition at line 68 of file OgreInputEvent.cpp. References mModifiers.

bool Ogre::InputEvent::isEventBetween | ( | int | start,
|  | int | end
| ) | const

| Definition at line 83 of file OgreInputEvent.cpp. References mId. Referenced by Ogre::EventDispatcher::dispatchEvent().

bool Ogre::InputEvent::isMetaDown | ( |  | ) | const

| Returns whether or not the Meta modifier is down on this event. Definition at line 73 of file OgreInputEvent.cpp. References mModifiers.

bool Ogre::InputEvent::isShiftDown | ( |  | ) | const

| Returns whether or not the Shift modifier is down on this event. Definition at line 78 of file OgreInputEvent.cpp. References mModifiers.

## Member Data Documentation

bool Ogre::InputEvent::mConsumed`[protected]`

| whether the event has been consumed Definition at line 88 of file OgreInputEvent.h. Referenced by consume(), InputEvent(), and isConsumed().

int Ogre::InputEvent::mId`[protected]`

| The ID of the event. Definition at line 83 of file OgreInputEvent.h. Referenced by getID(), and isEventBetween().

int Ogre::InputEvent::mModifiers`[protected]`

| The state of the modifier keys at the time the input event was fired. Definition at line 72 of file OgreInputEvent.h. Referenced by Ogre::KeyEvent::getKeyChar(), getModifiers(), isAltDown(), isControlDown(), isMetaDown(), and isShiftDown().

EventTarget* Ogre::InputEvent::mSource`[protected]`

| The target to process the event. This is ususally found by the dispatcher Definition at line 78 of file OgreInputEvent.h. Referenced by getSource().

Real Ogre::InputEvent::mWhen`[protected]`

| Not implemented yet. Definition at line 67 of file OgreInputEvent.h. Referenced by getWhen().

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

- OgreInputEvent.h
- OgreInputEvent.cpp

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:07 2004