#include <OgreMouseEvent.h>
Inheritance diagram for Ogre::MouseEvent:
Public Types | |
enum | { ME_FIRST_EVENT = 500, ME_LAST_EVENT = 506 } |
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 } |
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 = 0x1111 << 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. More... | |
int | getClickCount () |
Return the number of mouse clicks associated with this event. More... | |
Real | getX () |
Returns the horizontal x position of the event relative to the source GuiElement. More... | |
Real | getY () |
Returns the vertical y position of the event relative to the source GuiElement. More... | |
Real | getZ () |
Returns the vertical y position of the event relative to the source GuiElement. More... | |
String | paramString () |
Returns a parameter string identifying this event. More... | |
void | translatePoint (Real x, Real y) |
Translates the event's coordinates to a new position by adding specified x (horizontal) and y (veritcal) offsets. More... | |
int | getButtonID () |
return the ID of the button. More... | |
void | consume () |
Consumes this event so that it will not be processed in the default manner by the source which originated it. More... | |
int | getModifiers () |
Returns the modifiers flag for this event. More... | |
Real | getWhen () |
Returns the timestamp of when this event occurred. More... | |
bool | isAltDown () |
Returns whether or not the Alt modifier is down on this event. More... | |
bool | isConsumed () |
Returns whether or not this event has been consumed. More... | |
bool | isControlDown () |
Returns whether or not the Control modifier is down on this event. More... | |
bool | isMetaDown () |
Returns whether or not the Meta modifier is down on this event. More... | |
bool | isShiftDown () |
Returns whether or not the Shift modifier is down on this event. More... | |
bool | isEventBetween (int start, int end) |
int | getID () |
EventTarget * | getSource () |
Protected Attributes | |
Real | mX |
The mouse events x coordinate. More... | |
Real | mY |
The mouse events y coordinate. More... | |
Real | mZ |
The mouse events z coordinate. More... | |
int | mButtonID |
Which button was pressed. More... | |
int | mClickCount |
not implemented yet. More... | |
Real | mWhen |
Not implemented yet. More... | |
int | mModifiers |
The state of the modifier keys at the time the input event was fired. More... | |
EventTarget * | mSource |
The target to process the event. More... | |
int | mId |
The ID of the event. More... | |
bool | mConsumed |
whether the event has been consumed. More... |
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.
|
|
|
|
|
|
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.
|
|
|
|
Returns the timestamp of when this event occurred. Not implemented yet |
|
Returns the horizontal x position of the event relative to the source GuiElement.
|
|
Returns the vertical y position of the event relative to the source GuiElement.
|
|
Returns the vertical y position of the event relative to the source GuiElement.
|
|
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.
|
|
not implemented yet.
|
|
whether the event has been consumed.
|
|
The ID of the event.
|
|
The state of the modifier keys at the time the input event was fired.
|
|
The target to process the event. This is ususally found by the dispatcher |
|
Not implemented yet.
|
|
The mouse events x coordinate. The x value is relative to the MouseTarget that fired the event. |
|
The mouse events y coordinate. The y value is relative to the MouseTarget that fired the event. |
|
The mouse events z coordinate. The z value is relative to the MouseTarget that fired the event. |
Copyright © 2002 by The OGRE Team