# wxJoystickEvent Class Reference
[Events]

`#include </home/work/projects/wx/2.9/wx/interface/wx/event.h>`

Inheritance diagram for wxJoystickEvent:
[legend]

## Detailed Description

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

## Events using this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxJoystickEvent& event)

Event macros:

- 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.
- EVT_JOYSTICK_EVENTS(func):
  Processes all joystick events.

##

Library: wxCore
Category: Events

See also:
  wxJoystick

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

List of all members.

## Constructor & Destructor Documentation

wxJoystickEvent::wxJoystickEvent | ( | wxEventType | eventType = `wxEVT_NULL`,
|  | int | state = `0`,
|  | int | joystick = `wxJOYSTICK1`,
|  | int | change = `0` |
| ) |  |  |

Constructor.

## Member Function Documentation

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

Parameters:

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

Parameters:

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

Parameters:

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

int wxJoystickEvent::GetZPosition | ( |  | ) | const

Returns the z position of the joystick event.

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.

|  | [ top ]