## wxJoystickEvent

This event class contains information about mouse events, particularly events received by windows.

Derived from

wxEvent

Include files

<wx/event.h>

Event table macros

To process a mouse event, use these event handler macros to direct input to member functions that take a wxJoystickEvent argument.

EVT_JOY_BUTTON_DOWN(func) | Process a wxEVT_JOY_BUTTON_DOWN event.
EVT_JOY_BUTTON_UP(func) | Process a wxEVT_JOY_BUTTON_UP event.
EVT_JOY_MOVE(func) | Process a wxEVT_JOY_MOVE event.
EVT_JOY_ZMOVE(func) | Process a wxEVT_JOY_ZMOVE event.

See also

wxJoystick

Members

wxJoystickEvent::wxJoystickEvent
wxJoystickEvent::ButtonDown
wxJoystickEvent::ButtonIsDown
wxJoystickEvent::ButtonUp
wxJoystickEvent::GetButtonChange
wxJoystickEvent::GetButtonState
wxJoystickEvent::GetJoystick
wxJoystickEvent::GetPosition
wxJoystickEvent::GetZPosition
wxJoystickEvent::IsButton
wxJoystickEvent::IsMove
wxJoystickEvent::IsZMove

### wxJoystickEvent::wxJoystickEvent

wxJoystickEvent(WXTYPE eventType = 0, int state = 0, int joystick = wxJOYSTICK1, int change = 0)

Constructor.

### wxJoystickEvent::ButtonDown

bool ButtonDown(int button = wxJOY_BUTTON_ANY) const

Returns TRUE if the event was a down event from the specified button (or any button).

Parameters

button

Can be wxJOY_BUTTONn where n is 1, 2, 3 or 4; or wxJOY_BUTTON_ANY to indicate any button down event.

### wxJoystickEvent::ButtonIsDown

bool ButtonIsDown(int button = wxJOY_BUTTON_ANY) const

Returns TRUE if the specified button (or any button) was in a down state.

Parameters

button

Can be wxJOY_BUTTONn where n is 1, 2, 3 or 4; or wxJOY_BUTTON_ANY to indicate any button down event.

### wxJoystickEvent::ButtonUp

bool ButtonUp(int button = wxJOY_BUTTON_ANY) const

Returns TRUE if the event was an up event from the specified button (or any button).

Parameters

button

Can be wxJOY_BUTTONn where n is 1, 2, 3 or 4; or wxJOY_BUTTON_ANY to indicate any button down event.

### wxJoystickEvent::GetButtonChange

int 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.

### wxJoystickEvent::GetButtonState

int GetButtonState() const

Returns the down state of the buttons. This is a bitlist of wxJOY_BUTTONn identifiers, where n is one of 1, 2, 3, 4.

### wxJoystickEvent::GetJoystick

int GetJoystick() const

Returns the identifier of the joystick generating the event - one of wxJOYSTICK1 and wxJOYSTICK2.

### wxJoystickEvent::GetPosition

wxPoint GetPosition() const

Returns the x, y position of the joystick event.

### wxJoystickEvent::GetZPosition

int GetZPosition() const

Returns the z position of the joystick event.

### wxJoystickEvent::IsButton

bool IsButton() const

Returns TRUE if this was a button up or down event (not 'is any button down?').

### wxJoystickEvent::IsMove

bool IsMove() const

Returns TRUE if this was an x, y move event.

### wxJoystickEvent::IsZMove

bool IsZMove() const

Returns TRUE if this was a z move event.