wxMouseEvent
generated from ../src/mod_gui/event/mouse.cpp
This event class contains information about mouse events.
Note the difference between methods like leftDown
and leftIsDown: the formet returns true when the event corresponds
to the left mouse button click while the latter returns true if the left mouse button
is currently being pressed. For example, when the user is dragging the mouse you can use
leftIsDown to test whether the left mouse button is (still) depressed.
Also, by convention, if leftDown returns true, leftIsDown
will also return true in wxWindows whatever the underlying GUI
behaviour is (which is platform-dependent).
The same applies, of course, to other mouse buttons as well.
See onMouseEvents, onEnterWindow, onLeaveWindow,
onLeftUp, onLeftDown, onLeftDClick,
onMiddleUp, onMiddleDown, onMiddleDClick,
onRightUp, onRightDown, onRightDClick.
Constants
Properties
| Name | Type | Description |
|---|---|---|
altDown ![]() |
Boolean | Returns true when the alt key is down at the time of the key event. |
button ![]() |
Integer | Get the button which is changing state |
controlDown ![]() |
Boolean | Returns true when the control key is down at the time of the event. |
dragging ![]() |
Boolean | Returns true when this is a dragging event. |
entering ![]() |
Boolean | Returns true when the mouse was entering the window. See leaving |
leaving ![]() |
Boolean | Returns true when the mouse was leaving the window. See entering. |
leftDClick ![]() |
Boolean | Returns true when the event is a left double click event (wxEVT_LEFT_DCLICK). |
leftDown ![]() |
Boolean | Returns true when the event is a left down event (wxEVT_LEFT_DOWN). |
leftIsDown ![]() |
Boolean | Returns true if the left mouse button is currently down, independent of the current event type. Please notice that it is not the same as leftDown which returns true if the left mouse button was just pressed. Rather, it describes the state of the mouse button before the event happened. |
linesPerAction ![]() |
Integer | Returns the configured number of lines (or whatever) to be scrolled per wheel action. Defaults to 1. |
metaDown ![]() |
Boolean | Returns true when the meta key was down at the time of the event. |
middleDClick ![]() |
Boolean | Returns true when the event is a middle double click event (wxEVT_MIDDLE_DCLICK). |
middleDown ![]() |
Boolean | Returns true when the event is a middle down event (wxEVT_MIDDLE_DOWN). |
middleIsDown ![]() |
Boolean | Returns true if the middle mouse button is currently down, independent of the current event type. |
moving ![]() |
Boolean | Returns true when this was a moving event (wxEVT_MOTION) |
position ![]() |
wxPoint | Returns the physical mouse position in pixels. |
rightDClick ![]() |
Boolean | Returns true when the event is a right double click event (wxEVT_RIGHT_DCLICK). |
rightDown ![]() |
Boolean | Returns true when the event is a right down event (wxEVT_RIGHT_DOWN). |
rightIsDown ![]() |
Boolean | Returns true if the right mouse button is currently down, independent of the current event type. |
shiftDown ![]() |
Boolean | Returns true when the shift key was down at the time of the event. |
wheelDelta ![]() |
Integer | Get wheel delta, normally 120. This is the threshold for action to be taken, and one such action (for example, scrolling one increment) should occur for each delta. |
wheelRotation ![]() |
Integer | Get wheel rotation, positive or negative indicates direction of rotation. Current devices all send an event when rotation is equal to +/-WheelDelta, but this allows for finer resolution devices to be created in the future. Because of this you shouldn't assume that one event is equal to 1 line or whatever, but you should be able to either do partial line scrolling or wait until +/-WheelDelta rotation values have been accumulated before scrolling. |
x ![]() |
Integer | Returns the x-coordinate of the physical mouse position. See position and y |
y ![]() |
Integer | Returns the y-coordinate of the physical mouse position. See position and x |
Methods
button
button(Number) : Boolean
| Name | Type | Default | Description |
|---|---|---|---|
| Number | Integer | The mouse button. |
Returns true if the identified mouse button is changing state. Valid values of button are 1, 2 or 3 for left, middle and right buttons respectively.
buttonDClick
buttonDClick(Number) : Boolean
| Name | Type | Default | Description |
|---|---|---|---|
| Number | Integer | The mouse button. |
If the argument is omitted, this returns true if the event was a mouse double click event. Otherwise the argument specifies which double click event was generated (1, 2 or 3 for left, middle and right buttons respectively).
buttonDown
buttonDown(Number) : Boolean
| Name | Type | Default | Description |
|---|---|---|---|
| Number | Integer | The mouse button. |
If the argument is omitted, this returns true if the event was a mouse button down event. Otherwise the argument specifies which button-down event was generated (1, 2 or 3 for left, middle and right buttons respectively).
buttonUp
buttonUp(Number) : Boolean
| Name | Type | Default | Description |
|---|---|---|---|
| Number | Integer | The mouse button. |
If the argument is omitted, this returns true if the event was a mouse button up event. Otherwise the argument specifies which button-up event was generated (1, 2 or 3 for left, middle and right buttons respectively).

© 2002 - 2007 Franky Braem.