wxJoystick allows an application to control one or more joysticks.
Derived from
Include files
<wx/joystick.h>
See also
Members
wxJoystick::wxJoystick
wxJoystick::~wxJoystick
wxJoystick::GetButtonState
wxJoystick::GetManufacturerId
wxJoystick::GetMovementThreshold
wxJoystick::GetNumberAxes
wxJoystick::GetNumberButtons
wxJoystick::GetNumberJoysticks
wxJoystick::GetPollingMax
wxJoystick::GetPollingMin
wxJoystick::GetProductId
wxJoystick::GetProductName
wxJoystick::GetPosition
wxJoystick::GetPOVPosition
wxJoystick::GetPOVCTSPosition
wxJoystick::GetRudderMax
wxJoystick::GetRudderMin
wxJoystick::GetRudderPosition
wxJoystick::GetUMax
wxJoystick::GetUMin
wxJoystick::GetUPosition
wxJoystick::GetVMax
wxJoystick::GetVMin
wxJoystick::GetVPosition
wxJoystick::GetXMax
wxJoystick::GetXMin
wxJoystick::GetYMax
wxJoystick::GetYMin
wxJoystick::GetZMax
wxJoystick::GetZMin
wxJoystick::GetZPosition
wxJoystick::HasPOV
wxJoystick::HasPOV4Dir
wxJoystick::HasPOVCTS
wxJoystick::HasRudder
wxJoystick::HasU
wxJoystick::HasV
wxJoystick::HasZ
wxJoystick::IsOk
wxJoystick::ReleaseCapture
wxJoystick::SetCapture
wxJoystick::SetMovementThreshold
wxJoystick(int joystick = wxJOYSTICK1)
Constructor. joystick may be one of wxJOYSTICK1, wxJOYSTICK2, indicating the joystick controller of interest.
~wxJoystick()
Destroys the wxJoystick object.
int GetButtonState() const
Returns the state of the joystick buttons. Every button is mapped to a single bit in the returned integer, with the first button being mapped to the least significant bit, and so on. A bitlist of wxJOY_BUTTONn identifiers, where n is 1, 2, 3 or 4 is available for historical reasons.
int GetManufacturerId() const
Returns the manufacturer id.
int GetMovementThreshold() const
Returns the movement threshold, the number of steps outside which the joystick is deemed to have moved.
int GetNumberAxes() const
Returns the number of axes for this joystick.
int GetNumberButtons() const
Returns the number of buttons for this joystick.
static int GetNumberJoysticks()
Returns the number of joysticks currently attached to the computer.
int GetPollingMax() const
Returns the maximum polling frequency.
int GetPollingMin() const
Returns the minimum polling frequency.
int GetProductId() const
Returns the product id for the joystick.
wxString GetProductName() const
Returns the product name for the joystick.
wxPoint GetPosition() const
Returns the x, y position of the joystick.
int GetPOVPosition() const
Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units, but limited to return 0, 9000, 18000 or 27000. Returns -1 on error.
int GetPOVCTSPosition() const
Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units. Returns -1 on error.
int GetRudderMax() const
Returns the maximum rudder position.
int GetRudderMin() const
Returns the minimum rudder position.
int GetRudderPosition() const
Returns the rudder position.
int GetUMax() const
Returns the maximum U position.
int GetUMin() const
Returns the minimum U position.
int GetUPosition() const
Gets the position of the fifth axis of the joystick, if it exists.
int GetVMax() const
Returns the maximum V position.
int GetVMin() const
Returns the minimum V position.
int GetVPosition() const
Gets the position of the sixth axis of the joystick, if it exists.
int GetXMax() const
Returns the maximum x position.
int GetXMin() const
Returns the minimum x position.
int GetYMax() const
Returns the maximum y position.
int GetYMin() const
Returns the minimum y position.
int GetZMax() const
Returns the maximum z position.
int GetZMin() const
Returns the minimum z position.
int GetZPosition() const
Returns the z position of the joystick.
bool HasPOV() const
Returns true if the joystick has a point of view control.
bool HasPOV4Dir() const
Returns true if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).
bool HasPOVCTS() const
Returns true if the joystick point-of-view supports continuous degree bearings.
bool HasRudder() const
Returns true if there is a rudder attached to the computer.
bool HasU() const
Returns true if the joystick has a U axis.
bool HasV() const
Returns true if the joystick has a V axis.
bool HasZ() const
Returns true if the joystick has a Z axis.
bool IsOk() const
Returns true if the joystick is functioning.
bool ReleaseCapture()
Releases the capture set by SetCapture.
Return value
true if the capture release succeeded.
See also
wxJoystick::SetCapture, wxJoystickEvent
bool SetCapture(wxWindow* win, int pollingFreq = 0)
Sets the capture to direct joystick events to win.
Parameters
win
pollingFreq
Return value
true if the capture succeeded.
See also
wxJoystick::ReleaseCapture, wxJoystickEvent
void SetMovementThreshold(int threshold)
Sets the movement threshold, the number of steps outside which the joystick is deemed to have moved.