back to gui 

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 read only Boolean Returns true when the alt key is down at the time of the key event.
button read only Integer Get the button which is changing state
controlDown read only Boolean Returns true when the control key is down at the time of the event.
dragging read only Boolean Returns true when this is a dragging event.
entering read only Boolean Returns true when the mouse was entering the window. See leaving
leaving read only Boolean Returns true when the mouse was leaving the window. See entering.
leftDClick read only Boolean Returns true when the event is a left double click event (wxEVT_LEFT_DCLICK).
leftDown read only Boolean Returns true when the event is a left down event (wxEVT_LEFT_DOWN).
leftIsDown read only 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 read only Integer Returns the configured number of lines (or whatever) to be scrolled per wheel action. Defaults to 1.
metaDown read only Boolean Returns true when the meta key was down at the time of the event.
middleDClick read only Boolean Returns true when the event is a middle double click event (wxEVT_MIDDLE_DCLICK).
middleDown read only Boolean Returns true when the event is a middle down event (wxEVT_MIDDLE_DOWN).
middleIsDown read only Boolean Returns true if the middle mouse button is currently down, independent of the current event type.
moving read only Boolean Returns true when this was a moving event (wxEVT_MOTION)
position read only wxPoint Returns the physical mouse position in pixels.
rightDClick read only Boolean Returns true when the event is a right double click event (wxEVT_RIGHT_DCLICK).
rightDown read only Boolean Returns true when the event is a right down event (wxEVT_RIGHT_DOWN).
rightIsDown read only Boolean Returns true if the right mouse button is currently down, independent of the current event type.
shiftDown read only Boolean Returns true when the shift key was down at the time of the event.
wheelDelta read only 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 read only 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 read only Integer Returns the x-coordinate of the physical mouse position. See position and y
y read only 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).




Design downloaded from Zeroweb.org: Free website templates, layouts, and tools.