contents up previous next

wxjoystick

wxjoystick allows an application to control one or more joysticks.

derived from

wxobject

include files

<wx/joystick.h>

see also

wxjoystickevent

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::wxjoystick

wxjoystick(int joystick = wxjoystick1)

constructor. joystick may be one of wxjoystick1, wxjoystick2, indicating the joystick controller of interest.


wxjoystick::~wxjoystick

~wxjoystick()

destroys the wxjoystick object.


wxjoystick::getbuttonstate

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.


wxjoystick::getmanufacturerid

int getmanufacturerid() const

returns the manufacturer id.


wxjoystick::getmovementthreshold

int getmovementthreshold() const

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


wxjoystick::getnumberaxes

int getnumberaxes() const

returns the number of axes for this joystick.


wxjoystick::getnumberbuttons

int getnumberbuttons() const

returns the number of buttons for this joystick.


wxjoystick::getnumberjoysticks

static int getnumberjoysticks()

returns the number of joysticks currently attached to the computer.


wxjoystick::getpollingmax

int getpollingmax() const

returns the maximum polling frequency.


wxjoystick::getpollingmin

int getpollingmin() const

returns the minimum polling frequency.


wxjoystick::getproductid

int getproductid() const

returns the product id for the joystick.


wxjoystick::getproductname

wxstring getproductname() const

returns the product name for the joystick.


wxjoystick::getposition

wxpoint getposition() const

returns the x, y position of the joystick.


wxjoystick::getpovposition

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.


wxjoystick::getpovctsposition

int getpovctsposition() const

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


wxjoystick::getruddermax

int getruddermax() const

returns the maximum rudder position.


wxjoystick::getruddermin

int getruddermin() const

returns the minimum rudder position.


wxjoystick::getrudderposition

int getrudderposition() const

returns the rudder position.


wxjoystick::getumax

int getumax() const

returns the maximum u position.


wxjoystick::getumin

int getumin() const

returns the minimum u position.


wxjoystick::getuposition

int getuposition() const

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


wxjoystick::getvmax

int getvmax() const

returns the maximum v position.


wxjoystick::getvmin

int getvmin() const

returns the minimum v position.


wxjoystick::getvposition

int getvposition() const

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


wxjoystick::getxmax

int getxmax() const

returns the maximum x position.


wxjoystick::getxmin

int getxmin() const

returns the minimum x position.


wxjoystick::getymax

int getymax() const

returns the maximum y position.


wxjoystick::getymin

int getymin() const

returns the minimum y position.


wxjoystick::getzmax

int getzmax() const

returns the maximum z position.


wxjoystick::getzmin

int getzmin() const

returns the minimum z position.


wxjoystick::getzposition

int getzposition() const

returns the z position of the joystick.


wxjoystick::haspov

bool haspov() const

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


wxjoystick::haspov4dir

bool haspov4dir() const

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


wxjoystick::haspovcts

bool haspovcts() const

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


wxjoystick::hasrudder

bool hasrudder() const

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


wxjoystick::hasu

bool hasu() const

returns true if the joystick has a u axis.


wxjoystick::hasv

bool hasv() const

returns true if the joystick has a v axis.


wxjoystick::hasz

bool hasz() const

returns true if the joystick has a z axis.


wxjoystick::isok

bool isok() const

returns true if the joystick is functioning.


wxjoystick::releasecapture

bool releasecapture()

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

pollingfreq

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.