#include </home/zeitlin/src/wx/github/interface/wx/event.h>
This event class contains information about joystick events, particularly events received by windows.
The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
Event macros:
wxEVT_JOY_BUTTON_DOWN
event. wxEVT_JOY_BUTTON_UP
event. wxEVT_JOY_MOVE
event. wxEVT_JOY_ZMOVE
event. Public Member Functions | |
wxJoystickEvent (wxEventType eventType=wxEVT_NULL, int state=0, int joystick=wxJOYSTICK1, int change=0) | |
Constructor. | |
bool | ButtonDown (int button=wxJOY_BUTTON_ANY) const |
Returns true if the event was a down event from the specified button (or any button). | |
bool | ButtonIsDown (int button=wxJOY_BUTTON_ANY) const |
Returns true if the specified button (or any button) was in a down state. | |
bool | ButtonUp (int button=wxJOY_BUTTON_ANY) const |
Returns true if the event was an up event from the specified button (or any button). | |
int | GetButtonChange () const |
Returns the identifier of the button changing state. | |
int | GetButtonState () const |
Returns the down state of the buttons. | |
int | GetJoystick () const |
Returns the identifier of the joystick generating the event - one of wxJOYSTICK1 and wxJOYSTICK2. | |
wxPoint | GetPosition () const |
Returns the x, y position of the joystick event. | |
int | GetZPosition () const |
Returns the z position of the joystick event. | |
bool | IsButton () const |
Returns true if this was a button up or down event (not 'is any button down?'). | |
bool | IsMove () const |
Returns true if this was an x, y move event. | |
bool | IsZMove () const |
Returns true if this was a z move event. |
wxJoystickEvent::wxJoystickEvent | ( | wxEventType | eventType = wxEVT_NULL , |
int | state = 0 , |
||
int | joystick = wxJOYSTICK1 , |
||
int | change = 0 |
||
) |
Constructor.
bool wxJoystickEvent::ButtonDown | ( | int | button = wxJOY_BUTTON_ANY | ) | const |
Returns true if the event was a down event from the specified button (or any button).
button | Can be wxJOY_BUTTONn where n is 1, 2, 3 or 4; or wxJOY_BUTTON_ANY to indicate any button down event. |
bool wxJoystickEvent::ButtonIsDown | ( | int | button = wxJOY_BUTTON_ANY | ) | const |
Returns true if the specified button (or any button) was in a down state.
button | Can be wxJOY_BUTTONn where n is 1, 2, 3 or 4; or wxJOY_BUTTON_ANY to indicate any button down event. |
bool wxJoystickEvent::ButtonUp | ( | int | button = wxJOY_BUTTON_ANY | ) | const |
Returns true if the event was an up event from the specified button (or any button).
button | Can be wxJOY_BUTTONn where n is 1, 2, 3 or 4; or wxJOY_BUTTON_ANY to indicate any button down event. |
int wxJoystickEvent::GetButtonChange | ( | ) | const |
Returns the identifier of the button changing state.
This is a wxJOY_BUTTONn
identifier, where n
is one of 1, 2, 3, 4.
int wxJoystickEvent::GetButtonState | ( | ) | const |
Returns the down state of the buttons.
This is a wxJOY_BUTTONn
identifier, where n
is one of 1, 2, 3, 4.
int wxJoystickEvent::GetJoystick | ( | ) | const |
Returns the identifier of the joystick generating the event - one of wxJOYSTICK1 and wxJOYSTICK2.
wxPoint wxJoystickEvent::GetPosition | ( | ) | const |
Returns the x, y position of the joystick event.
These coordinates are valid for all the events except wxEVT_JOY_ZMOVE.
int wxJoystickEvent::GetZPosition | ( | ) | const |
Returns the z position of the joystick event.
This method can only be used for wxEVT_JOY_ZMOVE events.
bool wxJoystickEvent::IsButton | ( | ) | const |
Returns true if this was a button up or down event (not 'is any button down?').
bool wxJoystickEvent::IsMove | ( | ) | const |
Returns true if this was an x, y move event.
bool wxJoystickEvent::IsZMove | ( | ) | const |
Returns true if this was a z move event.