#include <OgreMouseEvent.h>
Inheritance diagram for Ogre::MouseEvent:
Public Types | |
enum | { ME_FIRST_EVENT = 500, ME_LAST_EVENT = 510 } |
enum | { ME_MOUSE_CLICKED = ME_FIRST_EVENT, ME_MOUSE_PRESSED, ME_MOUSE_RELEASED, ME_MOUSE_MOVED, ME_MOUSE_ENTERED, ME_MOUSE_EXITED, ME_MOUSE_DRAGGED, ME_MOUSE_DRAGENTERED, ME_MOUSE_DRAGEXITED, ME_MOUSE_DRAGMOVED, ME_MOUSE_DRAGDROPPED } |
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 | |
MouseEvent (PositionTarget *source, int id, int whichButton, Real when, int modifiers, Real x, Real y, Real z, int clickCount) | |
Constructs a MouseEvent object with the specified source MouseTarget, type, modifiers, coordinates, and click count. | |
MouseEvent (PositionTarget *source, int id, int whichButton, Real when, int modifiers, Real x, Real y, Real z, Real relx, Real rely, Real relz, int clickCount) | |
int | getClickCount () |
Return the number of mouse clicks associated with this event. | |
Real | getX () const |
Returns the horizontal x position of the event relative to the source GuiElement. | |
Real | getY () const |
Returns the vertical y position of the event relative to the source GuiElement. | |
Real | getZ () const |
Returns the vertical y position of the event relative to the source GuiElement. | |
Real | getRelX () const |
get relative X cursor movement | |
Real | getRelY () const |
get relative Y cursor movement | |
Real | getRelZ () const |
get relative Z cursor movement | |
String | paramString () const |
Returns a parameter string identifying this event. | |
void | translatePoint (Real x, Real y) |
Translates the event's coordinates to a new position by adding specified x (horizontal) and y (veritcal) offsets. | |
int | getButtonID () const |
return the ID of the button | |
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 | mX |
The mouse events x coordinate. | |
Real | mY |
The mouse events y coordinate. | |
Real | mZ |
The mouse events z coordinate. | |
Real | mRelX |
Real | mRelY |
Real | mRelZ |
int | mButtonID |
Which button was pressed. | |
int | mClickCount |
not implemented yet | |
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 |
This low-level event is generated by a MouseTarget object for:
A MouseEvent object is passed to every MouseListener object which registered to receive the "interesting" mouse events using MouseTarget's addMouseListener
method.
A MouseEvent object is also passed to every MouseMotionListener object which registered to receive mouse motion events using the MouseTarget's addMouseMotionListener method
When a mouse button is clicked, events are generated and sent to the registered MouseListeners, with the button mask set in the modifier field. For example, if the first mouse button is pressed, events are sent in the following order:
MOUSE_PRESSED: BUTTON1_MASK MOUSE_RELEASED: BUTTON1_MASK MOUSE_CLICKED: BUTTON1_MASKWhen multiple mouse buttons are pressed, each press, release, and click results in a separate event. The button mask in the modifier field reflects only the button that changed state, not the current state of all buttons.
For example, if the user presses button 1 followed by button 2 and releases them in the same order, the following sequence of events is generated:
MOUSE_PRESSED: BUTTON1_MASK MOUSE_PRESSED: BUTTON2_MASK MOUSE_RELEASED: BUTTON1_MASK MOUSE_CLICKED: BUTTON1_MASK MOUSE_RELEASED: BUTTON2_MASK MOUSE_CLICKED: BUTTON2_MASKIf button2 is released first, the MOUSE_RELEASED/MOUSE_CLICKED pair for BUTTON2_MASK arrives first, followed by the pair for BUTTON1_MASK.
Definition at line 158 of file OgreMouseEvent.h.
|
Definition at line 201 of file OgreMouseEvent.h. |
|
Definition at line 207 of file OgreMouseEvent.h. |
|
Definition at line 93 of file OgreInputEvent.h. |
|
Constructs a MouseEvent object with the specified source MouseTarget, type, modifiers, coordinates, and click count.
Definition at line 34 of file OgreMouseEvent.cpp. References Ogre::Real. |
|
Definition at line 44 of file OgreMouseEvent.cpp. References Ogre::Real. |
|
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 Ogre::InputEvent::mConsumed. Referenced by Ogre::EventDispatcher::retargetMouseEvent(). |
|
return the ID of the button
Definition at line 97 of file OgreMouseEvent.cpp. References mButtonID. Referenced by Ogre::EventDispatcher::retargetMouseEvent(). |
|
Return the number of mouse clicks associated with this event.
Definition at line 62 of file OgreMouseEvent.cpp. References mClickCount. Referenced by Ogre::EventDispatcher::retargetMouseEvent(). |
|
|
Returns the modifiers flag for this event.
Definition at line 48 of file OgreInputEvent.cpp. References Ogre::InputEvent::mModifiers. Referenced by paramString(), Ogre::EventDispatcher::retargetKeyEvent(), and Ogre::EventDispatcher::retargetMouseEvent(). |
|
get relative X cursor movement
Definition at line 277 of file OgreMouseEvent.h. References Ogre::Real. |
|
get relative Y cursor movement
Definition at line 280 of file OgreMouseEvent.h. References Ogre::Real. |
|
get relative Z cursor movement
Definition at line 283 of file OgreMouseEvent.h. References Ogre::Real. |
|
Definition at line 95 of file OgreInputEvent.cpp. References Ogre::InputEvent::mSource. Referenced by Ogre::ScrollBarGuiElement::mousePressed(), and Ogre::ListGuiElement::mousePressed(). |
|
Returns the timestamp of when this event occurred. Not implemented yet Definition at line 53 of file OgreInputEvent.cpp. References Ogre::InputEvent::mWhen, and Ogre::Real. Referenced by Ogre::EventDispatcher::retargetKeyEvent(), and Ogre::EventDispatcher::retargetMouseEvent(). |
|
Returns the horizontal x position of the event relative to the source GuiElement.
Definition at line 73 of file OgreMouseEvent.cpp. References mX, and Ogre::Real. Referenced by Ogre::ListGuiElement::mouseDragged(), Ogre::PopupMenuGuiElement::mouseMoved(), Ogre::CursorGuiElement::mouseMoved(), Ogre::EventDispatcher::processMouseEvent(), and Ogre::EventDispatcher::retargetMouseEvent(). |
|
Returns the vertical y position of the event relative to the source GuiElement.
Definition at line 83 of file OgreMouseEvent.cpp. References mY, and Ogre::Real. Referenced by Ogre::ScrollBarGuiElement::mouseDragged(), Ogre::ListGuiElement::mouseDragged(), Ogre::PopupMenuGuiElement::mouseMoved(), Ogre::CursorGuiElement::mouseMoved(), Ogre::ScrollBarGuiElement::mousePressed(), Ogre::EventDispatcher::processMouseEvent(), and Ogre::EventDispatcher::retargetMouseEvent(). |
|
Returns the vertical y position of the event relative to the source GuiElement.
Definition at line 94 of file OgreMouseEvent.cpp. References mZ, and Ogre::Real. Referenced by Ogre::EventDispatcher::retargetMouseEvent(). |
|
Returns whether or not the Alt modifier is down on this event.
Definition at line 58 of file OgreInputEvent.cpp. References Ogre::InputEvent::mModifiers. |
|
Returns whether or not this event has been consumed.
Definition at line 63 of file OgreInputEvent.cpp. References Ogre::InputEvent::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(). |
|
Returns whether or not the Control modifier is down on this event.
Definition at line 68 of file OgreInputEvent.cpp. References Ogre::InputEvent::mModifiers. |
|
Definition at line 83 of file OgreInputEvent.cpp. References Ogre::InputEvent::mId. Referenced by Ogre::EventDispatcher::dispatchEvent(). |
|
Returns whether or not the Meta modifier is down on this event.
Definition at line 73 of file OgreInputEvent.cpp. References Ogre::InputEvent::mModifiers. |
|
Returns whether or not the Shift modifier is down on this event.
Definition at line 78 of file OgreInputEvent.cpp. References Ogre::InputEvent::mModifiers. |
|
Returns a parameter string identifying this event. This method is useful for event-logging and for debugging.
Definition at line 109 of file OgreMouseEvent.cpp. References Ogre::InputEvent::getModifiers(), mClickCount, ME_MOUSE_CLICKED, ME_MOUSE_DRAGDROPPED, ME_MOUSE_DRAGENTERED, ME_MOUSE_DRAGEXITED, ME_MOUSE_DRAGGED, ME_MOUSE_DRAGMOVED, ME_MOUSE_ENTERED, ME_MOUSE_EXITED, ME_MOUSE_MOVED, ME_MOUSE_PRESSED, ME_MOUSE_RELEASED, mX, mY, and Ogre::String. |
|
Translates the event's coordinates to a new position by adding specified x (horizontal) and y (veritcal) offsets.
Definition at line 159 of file OgreMouseEvent.cpp. References mX, mY, and Ogre::Real. |
|
Which button was pressed.
Definition at line 190 of file OgreMouseEvent.h. Referenced by getButtonID(). |
|
not implemented yet
Definition at line 194 of file OgreMouseEvent.h. Referenced by getClickCount(), and paramString(). |
|
whether the event has been consumed
Definition at line 88 of file OgreInputEvent.h. Referenced by Ogre::InputEvent::consume(), Ogre::InputEvent::InputEvent(), and Ogre::InputEvent::isConsumed(). |
|
The ID of the event.
Definition at line 83 of file OgreInputEvent.h. Referenced by Ogre::InputEvent::getID(), and Ogre::InputEvent::isEventBetween(). |
|
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(), Ogre::InputEvent::getModifiers(), Ogre::InputEvent::isAltDown(), Ogre::InputEvent::isControlDown(), Ogre::InputEvent::isMetaDown(), and Ogre::InputEvent::isShiftDown(). |
|
Definition at line 182 of file OgreMouseEvent.h. |
|
Definition at line 183 of file OgreMouseEvent.h. |
|
Definition at line 184 of file OgreMouseEvent.h. |
|
The target to process the event. This is ususally found by the dispatcher Definition at line 78 of file OgreInputEvent.h. Referenced by Ogre::InputEvent::getSource(). |
|
Not implemented yet.
Definition at line 67 of file OgreInputEvent.h. Referenced by Ogre::InputEvent::getWhen(). |
|
The mouse events x coordinate. The x value is relative to the MouseTarget that fired the event. Definition at line 166 of file OgreMouseEvent.h. Referenced by getX(), paramString(), and translatePoint(). |
|
The mouse events y coordinate. The y value is relative to the MouseTarget that fired the event. Definition at line 172 of file OgreMouseEvent.h. Referenced by getY(), paramString(), and translatePoint(). |
|
The mouse events z coordinate. The z value is relative to the MouseTarget that fired the event. Definition at line 179 of file OgreMouseEvent.h. Referenced by getZ(). |
Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:15 2004