#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 Member Functions | |
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 MouseTarget. | |
Real | getY () const |
Returns the vertical y position of the event relative to the source MouseTarget. | |
Real | getZ () const |
Returns the scrollwheel z position of the event relative to the source MouseTarget. | |
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 |
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.
Member Enumeration Documentation
|
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.
|
|
|
|
Consumes this event so that it will not be processed in the default manner by the source which originated it.
|
|
return the ID of the button
|
|
Return the number of mouse clicks associated with this event.
|
|
|
|
Returns the modifiers flag for this event.
|
|
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. |
|
|
|
Returns the timestamp of when this event occurred. Not implemented yet |
|
Returns the horizontal x position of the event relative to the source MouseTarget.
|
|
Returns the vertical y position of the event relative to the source MouseTarget.
|
|
Returns the scrollwheel z position of the event relative to the source MouseTarget.
|
|
Returns whether or not the Alt modifier is down on this event.
|
|
Returns whether or not this event has been consumed.
|
|
Returns whether or not the Control modifier is down on this event.
|
|
|
|
Returns whether or not the Meta modifier is down on this event.
|
|
Returns whether or not the Shift modifier is down on this event.
|
|
Returns a parameter string identifying this event. This method is useful for event-logging and for debugging.
|
|
Translates the event's coordinates to a new position by adding specified x (horizontal) and y (veritcal) offsets.
|
|
Which button was pressed.
Definition at line 190 of file OgreMouseEvent.h. |
|
not implemented yet
Definition at line 194 of file OgreMouseEvent.h. |
|
whether the event has been consumed
Definition at line 88 of file OgreInputEvent.h. |
|
The ID of the event.
Definition at line 83 of file OgreInputEvent.h. |
|
The state of the modifier keys at the time the input event was fired.
Definition at line 72 of file OgreInputEvent.h. |
|
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. |
|
Not implemented yet.
Definition at line 67 of file OgreInputEvent.h. |
|
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. |
|
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. |
|
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. |
Copyright © 2000-2005 by The OGRE Team
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:40:27 2006