wxJoystick

wxJoystick allows an application to control one or more joysticks.

Derived from

wxObject

Include files

<wx/joystick.h>

See also

wxJoystickEvent



wxJoystick::wxJoystick



wxJoystick(int joystick = wxJOYSTICK1)

Constructor. joystick may be one of wxJOYSTICK1, wxJOYSTICK2, indicating the joystick controller of interest.



wxJoystick::~wxJoystick



~wxJoystick(void)

Destroys the wxJoystick object.



wxJoystick::GetButtonState

int GetButtonState(void) 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.



wxJoystick::GetManufacturerId

int GetManufacturerId(void) const

Returns the manufacturer id.



wxJoystick::GetMovementThreshold

int GetMovementThreshold(void) const

Returns the movement threshold, the number of steps outside which the joystick is deemed to have moved.



wxJoystick::GetNumberAxes

int GetNumberAxes(void) const

Returns the number of axes for this joystick.



wxJoystick::GetNumberButtons

int GetNumberButtons(void) const

Returns the number of buttons for this joystick.



wxJoystick::GetNumberJoysticks

int GetNumberJoysticks(void) const

Returns the number of joysticks currently attached to the computer.



wxJoystick::GetPollingMax

int GetPollingMax(void) const

Returns the maximum polling frequency.



wxJoystick::GetPollingMin

int GetPollingMin(void) const

Returns the minimum polling frequency.



wxJoystick::GetProductId

int GetProductId(void) const

Returns the product id for the joystick.



wxJoystick::GetProductName

wxString GetProductName(void) const

Returns the product name for the joystick.



wxJoystick::GetPosition

wxPoint GetPosition(void) const

Returns the x, y position of the joystick.



wxJoystick::GetPOVPosition

int GetPOVPosition(void) 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.



wxJoystick::GetPOVCTSPosition

int GetPOVCTSPosition(void) const

Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units. Returns -1 on error.



wxJoystick::GetRudderMax

int GetRudderMax(void) const

Returns the maximum rudder position.



wxJoystick::GetRudderMin

int GetRudderMin(void) const

Returns the minimum rudder position.



wxJoystick::GetRudderPosition

int GetRudderPosition(void) const

Returns the rudder position.



wxJoystick::GetUMax

int GetUMax(void) const

Returns the maximum U position.



wxJoystick::GetUMin

int GetUMin(void) const

Returns the minimum U position.



wxJoystick::GetUPosition

int GetUPosition(void) const

Gets the position of the fifth axis of the joystick, if it exists.



wxJoystick::GetVMax

int GetVMax(void) const

Returns the maximum V position.



wxJoystick::GetVMin

int GetVMin(void) const

Returns the minimum V position.



wxJoystick::GetVPosition

int GetVPosition(void) const

Gets the position of the sixth axis of the joystick, if it exists.



wxJoystick::GetXMax

int GetXMax(void) const

Returns the maximum x position.



wxJoystick::GetXMin

int GetXMin(void) const

Returns the minimum x position.



wxJoystick::GetYMax

int GetYMax(void) const

Returns the maximum y position.



wxJoystick::GetYMin

int GetYMin(void) const

Returns the minimum y position.



wxJoystick::GetZMax

int GetZMax(void) const

Returns the maximum z position.



wxJoystick::GetZMin

int GetZMin(void) const

Returns the minimum z position.



wxJoystick::GetZPosition

int GetZPosition(void) const

Returns the z position of the joystick.



wxJoystick::HasPOV

bool HasPOV(void) const

Returns true if the joystick has a point of view control.



wxJoystick::HasPOV4Dir

bool HasPOV4Dir(void) const

Returns true if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).



wxJoystick::HasPOVCTS

bool HasPOVCTS(void) const

Returns true if the joystick point-of-view supports continuous degree bearings.



wxJoystick::HasRudder

bool HasRudder(void) const

Returns true if there is a rudder attached to the computer.



wxJoystick::HasU

bool HasU(void) const

Returns true if the joystick has a U axis.



wxJoystick::HasV

bool HasV(void) const

Returns true if the joystick has a V axis.



wxJoystick::HasZ

bool HasZ(void) const

Returns true if the joystick has a Z axis.



wxJoystick::IsOk

bool IsOk(void) const

Returns true if the joystick is functioning.



wxJoystick::ReleaseCapture



bool ReleaseCapture(void)

Releases the capture set by SetCapture.

Return value

true if the capture release succeeded.

See also

wxJoystick::SetCapture, wxJoystickEvent



wxJoystick::SetCapture



bool SetCapture(wxWindow* win, int pollingFreq = 0)

Sets the capture to direct joystick events to win.

Parameters

win
The window that will receive joystick events.

pollingFreq
If zero, movement events are sent when above the threshold. If greater than zero, events are received every pollingFreq milliseconds.

Return value

true if the capture succeeded.

See also

wxJoystick::ReleaseCapture, wxJoystickEvent



wxJoystick::SetMovementThreshold



void SetMovementThreshold(int threshold)

Sets the movement threshold, the number of steps outside which the joystick is deemed to have moved.

ymasuda 平成17年11月19日