wxJoystick Class Reference

#include <wx/joystick.h>

Inheritance diagram for wxJoystick:

wxObject

List of all members.


Detailed Description

wxJoystick allows an application to control one or more joysticks.

Library:  wxAdvanced

Category:  group_class_FIXME

See also:
wxJoystickEvent

Public Member Functions

 wxJoystick (int joystick=wxJOYSTICK1)
virtual ~wxJoystick ()
int GetManufacturerId () const
int GetMovementThreshold () const
int GetNumberAxes () const
int GetNumberButtons () const
int GetPOVCTSPosition () const
int GetPOVPosition () const
int GetPollingMax () const
int GetPollingMin () const
int GetProductId () const
wxString GetProductName () const
int GetRudderMax () const
int GetRudderMin () const
int GetRudderPosition () const
int GetUMax () const
int GetUMin () const
int GetUPosition () const
int GetVMax () const
int GetVMin () const
int GetVPosition () const
int GetXMax () const
int GetXMin () const
int GetYMax () const
int GetYMin () const
int GetZMax () const
int GetZMin () const
int GetZPosition () const
bool HasPOV () const
bool HasPOV4Dir () const
bool HasRudder () const
bool HasU () const
bool HasV () const
bool HasZ () const
bool IsOk () const
bool ReleaseCapture ()
bool SetCapture (wxWindow *win, int pollingFreq=0)
void SetMovementThreshold (int threshold)
int GetButtonState () const
const bool GetButtonState (unsigned id) const
wxPoint GetPosition () const
const int GetPosition (unsigned axis) const

Static Public Member Functions

static int GetNumberJoysticks ()

Constructor & Destructor Documentation

wxJoystick::wxJoystick ( int  joystick = wxJOYSTICK1  ) 

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

virtual wxJoystick::~wxJoystick (  )  [virtual]

Destroys the wxJoystick object.


Member Function Documentation

int wxJoystick::GetButtonState (  )  const

Returns the state of the specified joystick button.

Parameters:
id The button id to report, from 0 to GetNumberButtons() - 1

const bool wxJoystick::GetButtonState ( unsigned  id  )  const

Returns the state of the specified joystick button.

Parameters:
id The button id to report, from 0 to GetNumberButtons() - 1

int wxJoystick::GetManufacturerId (  )  const

Returns the manufacturer id.

int wxJoystick::GetMovementThreshold (  )  const

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

int wxJoystick::GetNumberAxes (  )  const

Returns the number of axes for this joystick.

int wxJoystick::GetNumberButtons (  )  const

Returns the number of buttons for this joystick.

static int wxJoystick::GetNumberJoysticks (  )  [static]

Returns the number of joysticks currently attached to the computer.

int wxJoystick::GetPOVCTSPosition (  )  const

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

int wxJoystick::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 wxJoystick::GetPollingMax (  )  const

Returns the maximum polling frequency.

int wxJoystick::GetPollingMin (  )  const

Returns the minimum polling frequency.

wxPoint wxJoystick::GetPosition (  )  const

Returns the position of the specified joystick axis.

Parameters:
axis The joystick axis to report, from 0 to GetNumberAxes() - 1.

const int wxJoystick::GetPosition ( unsigned  axis  )  const

Returns the position of the specified joystick axis.

Parameters:
axis The joystick axis to report, from 0 to GetNumberAxes() - 1.

int wxJoystick::GetProductId (  )  const

Returns the product id for the joystick.

wxString wxJoystick::GetProductName (  )  const

Returns the product name for the joystick.

int wxJoystick::GetRudderMax (  )  const

Returns the maximum rudder position.

int wxJoystick::GetRudderMin (  )  const

Returns the minimum rudder position.

int wxJoystick::GetRudderPosition (  )  const

Returns the rudder position.

int wxJoystick::GetUMax (  )  const

Returns the maximum U position.

int wxJoystick::GetUMin (  )  const

Returns the minimum U position.

int wxJoystick::GetUPosition (  )  const

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

int wxJoystick::GetVMax (  )  const

Returns the maximum V position.

int wxJoystick::GetVMin (  )  const

Returns the minimum V position.

int wxJoystick::GetVPosition (  )  const

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

int wxJoystick::GetXMax (  )  const

Returns the maximum x position.

int wxJoystick::GetXMin (  )  const

Returns the minimum x position.

int wxJoystick::GetYMax (  )  const

Returns the maximum y position.

int wxJoystick::GetYMin (  )  const

Returns the minimum y position.

int wxJoystick::GetZMax (  )  const

Returns the maximum z position.

int wxJoystick::GetZMin (  )  const

Returns the minimum z position.

int wxJoystick::GetZPosition (  )  const

Returns the z position of the joystick.

bool wxJoystick::HasPOV (  )  const

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

bool wxJoystick::HasPOV4Dir (  )  const

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

bool wxJoystick::HasRudder (  )  const

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

bool wxJoystick::HasU (  )  const

Returns true if the joystick has a U axis.

bool wxJoystick::HasV (  )  const

Returns true if the joystick has a V axis.

bool wxJoystick::HasZ (  )  const

Returns true if the joystick has a Z axis.

bool wxJoystick::IsOk (  )  const

Returns true if the joystick is functioning.

bool wxJoystick::ReleaseCapture (  ) 

Releases the capture set by SetCapture.

Returns:
true if the capture release succeeded.
See also:
SetCapture(), wxJoystickEvent

bool wxJoystick::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.
Returns:
true if the capture succeeded.
See also:
ReleaseCapture(), wxJoystickEvent

void wxJoystick::SetMovementThreshold ( int  threshold  ) 

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



wxWidgets logo

[ top ]