1998-06-14 16:48:39 -04:00
|
|
|
\section{\class{wxJoystick}}\label{wxjoystick}
|
|
|
|
|
|
|
|
wxJoystick allows an application to control one or more joysticks.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/joystick.h>
|
|
|
|
|
1998-06-14 16:48:39 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxJoystickEvent}{wxjoystickevent}
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-09-29 07:25:34 -04:00
|
|
|
\membersection{wxJoystick::wxJoystick}\label{wxjoystickctor}
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\func{}{wxJoystick}{\param{int}{ joystick = wxJOYSTICK1}}
|
|
|
|
|
|
|
|
Constructor. {\it joystick} may be one of wxJOYSTICK1, wxJOYSTICK2, indicating the joystick
|
|
|
|
controller of interest.
|
|
|
|
|
2004-09-29 07:25:34 -04:00
|
|
|
\membersection{wxJoystick::\destruct{wxJoystick}}\label{wxjoystickdtor}
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\func{}{\destruct{wxJoystick}}{\void}
|
|
|
|
|
|
|
|
Destroys the wxJoystick object.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetButtonState}\label{wxjoystickgetbuttonstate}
|
|
|
|
|
|
|
|
\constfunc{int}{GetButtonState}{\void}
|
|
|
|
|
Applied patch [ 597700 ] Fix proposal for wxJoystick under MSW
Proposed fixes for the wxWindows joystick code under
MSW.
Some of these would be valid for other platforms, too.
Events for buttons are named wrong, docs say different.
Docs say EVT_JOY_BUTTON_DOWN and
EVT_JOY_BUTTON_UP,
but the code says EVT_JOY_DOWN and EVT_JOY_UP. I
suggest
changing the code to match the docs.
wxJoystick::GetNumberJoysticks() should be a static
member
function. Having to create a joystick object to see if there
are joysticks is silly.
Docs for GetNumberJoysticks() must be changed; it returns
the
number of potentially connected joysticks, not the number of
actually connected. Alternatively, GetNumberJoysticks() and
others must be rewritten to conform with documentation,
including
remapping of wxWindows sequential joystick ID's to match
MSW non-sequential joystick ID's.
dwSize is not set when joyGetPosEx() is called. SEVERE
ERROR.
Error return value from functions should not be a legal
return,
for instance, wxJoystick::GetPOVCTSPosition() returns 0
for error,
but this is a legal return value.
GetButtonState() supports only four (out of 32) buttons.
Also, should return as bitmap (LSB = button 1). (Win32
does this,
although not documented as such).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-08-20 13:16:05 -04:00
|
|
|
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.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::GetManufacturerId}\label{wxjoystickgetmanufacturerid}
|
|
|
|
|
|
|
|
\constfunc{int}{GetManufacturerId}{\void}
|
|
|
|
|
|
|
|
Returns the manufacturer id.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetMovementThreshold}\label{wxjoystickgetmovementthreshold}
|
|
|
|
|
|
|
|
\constfunc{int}{GetMovementThreshold}{\void}
|
|
|
|
|
|
|
|
Returns the movement threshold, the number of steps outside which the joystick is deemed to have
|
|
|
|
moved.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetNumberAxes}\label{wxjoystickgetnumberaxes}
|
|
|
|
|
|
|
|
\constfunc{int}{GetNumberAxes}{\void}
|
|
|
|
|
|
|
|
Returns the number of axes for this joystick.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetNumberButtons}\label{wxjoystickgetnumberbuttons}
|
|
|
|
|
|
|
|
\constfunc{int}{GetNumberButtons}{\void}
|
|
|
|
|
|
|
|
Returns the number of buttons for this joystick.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetNumberJoysticks}\label{wxjoystickgetnumberjoysticks}
|
|
|
|
|
|
|
|
\constfunc{int}{GetNumberJoysticks}{\void}
|
|
|
|
|
|
|
|
Returns the number of joysticks currently attached to the computer.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetPollingMax}\label{wxjoystickgetpollingmax}
|
|
|
|
|
|
|
|
\constfunc{int}{GetPollingMax}{\void}
|
|
|
|
|
|
|
|
Returns the maximum polling frequency.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetPollingMin}\label{wxjoystickgetpollingmin}
|
|
|
|
|
|
|
|
\constfunc{int}{GetPollingMin}{\void}
|
|
|
|
|
|
|
|
Returns the minimum polling frequency.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetProductId}\label{wxjoystickgetproductid}
|
|
|
|
|
|
|
|
\constfunc{int}{GetProductId}{\void}
|
|
|
|
|
|
|
|
Returns the product id for the joystick.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetProductName}\label{wxjoystickgetproductname}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetProductName}{\void}
|
|
|
|
|
|
|
|
Returns the product name for the joystick.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetPosition}\label{wxjoystickgetposition}
|
|
|
|
|
|
|
|
\constfunc{wxPoint}{GetPosition}{\void}
|
|
|
|
|
|
|
|
Returns the x, y position of the joystick.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetPOVPosition}\label{wxjoystickgetpovposition}
|
|
|
|
|
|
|
|
\constfunc{int}{GetPOVPosition}{\void}
|
|
|
|
|
Applied patch [ 597700 ] Fix proposal for wxJoystick under MSW
Proposed fixes for the wxWindows joystick code under
MSW.
Some of these would be valid for other platforms, too.
Events for buttons are named wrong, docs say different.
Docs say EVT_JOY_BUTTON_DOWN and
EVT_JOY_BUTTON_UP,
but the code says EVT_JOY_DOWN and EVT_JOY_UP. I
suggest
changing the code to match the docs.
wxJoystick::GetNumberJoysticks() should be a static
member
function. Having to create a joystick object to see if there
are joysticks is silly.
Docs for GetNumberJoysticks() must be changed; it returns
the
number of potentially connected joysticks, not the number of
actually connected. Alternatively, GetNumberJoysticks() and
others must be rewritten to conform with documentation,
including
remapping of wxWindows sequential joystick ID's to match
MSW non-sequential joystick ID's.
dwSize is not set when joyGetPosEx() is called. SEVERE
ERROR.
Error return value from functions should not be a legal
return,
for instance, wxJoystick::GetPOVCTSPosition() returns 0
for error,
but this is a legal return value.
GetButtonState() supports only four (out of 32) buttons.
Also, should return as bitmap (LSB = button 1). (Win32
does this,
although not documented as such).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-08-20 13:16:05 -04:00
|
|
|
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.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::GetPOVCTSPosition}\label{wxjoystickgetpovctsposition}
|
|
|
|
|
|
|
|
\constfunc{int}{GetPOVCTSPosition}{\void}
|
|
|
|
|
|
|
|
Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units.
|
Applied patch [ 597700 ] Fix proposal for wxJoystick under MSW
Proposed fixes for the wxWindows joystick code under
MSW.
Some of these would be valid for other platforms, too.
Events for buttons are named wrong, docs say different.
Docs say EVT_JOY_BUTTON_DOWN and
EVT_JOY_BUTTON_UP,
but the code says EVT_JOY_DOWN and EVT_JOY_UP. I
suggest
changing the code to match the docs.
wxJoystick::GetNumberJoysticks() should be a static
member
function. Having to create a joystick object to see if there
are joysticks is silly.
Docs for GetNumberJoysticks() must be changed; it returns
the
number of potentially connected joysticks, not the number of
actually connected. Alternatively, GetNumberJoysticks() and
others must be rewritten to conform with documentation,
including
remapping of wxWindows sequential joystick ID's to match
MSW non-sequential joystick ID's.
dwSize is not set when joyGetPosEx() is called. SEVERE
ERROR.
Error return value from functions should not be a legal
return,
for instance, wxJoystick::GetPOVCTSPosition() returns 0
for error,
but this is a legal return value.
GetButtonState() supports only four (out of 32) buttons.
Also, should return as bitmap (LSB = button 1). (Win32
does this,
although not documented as such).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-08-20 13:16:05 -04:00
|
|
|
Returns -1 on error.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::GetRudderMax}\label{wxjoystickgetruddermax}
|
|
|
|
|
|
|
|
\constfunc{int}{GetRudderMax}{\void}
|
|
|
|
|
|
|
|
Returns the maximum rudder position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetRudderMin}\label{wxjoystickgetruddermin}
|
|
|
|
|
|
|
|
\constfunc{int}{GetRudderMin}{\void}
|
|
|
|
|
|
|
|
Returns the minimum rudder position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetRudderPosition}\label{wxjoystickgetrudderposition}
|
|
|
|
|
|
|
|
\constfunc{int}{GetRudderPosition}{\void}
|
|
|
|
|
|
|
|
Returns the rudder position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetUMax}\label{wxjoystickgetumax}
|
|
|
|
|
|
|
|
\constfunc{int}{GetUMax}{\void}
|
|
|
|
|
|
|
|
Returns the maximum U position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetUMin}\label{wxjoystickgetumin}
|
|
|
|
|
|
|
|
\constfunc{int}{GetUMin}{\void}
|
|
|
|
|
|
|
|
Returns the minimum U position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetUPosition}\label{wxjoystickgetuposition}
|
|
|
|
|
|
|
|
\constfunc{int}{GetUPosition}{\void}
|
|
|
|
|
|
|
|
Gets the position of the fifth axis of the joystick, if it exists.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetVMax}\label{wxjoystickgetvmax}
|
|
|
|
|
|
|
|
\constfunc{int}{GetVMax}{\void}
|
|
|
|
|
|
|
|
Returns the maximum V position.
|
|
|
|
|
1998-07-29 02:51:33 -04:00
|
|
|
\membersection{wxJoystick::GetVMin}\label{wxjoystickgetvmin}
|
1998-06-14 16:48:39 -04:00
|
|
|
|
1998-07-29 02:51:33 -04:00
|
|
|
\constfunc{int}{GetVMin}{\void}
|
1998-06-14 16:48:39 -04:00
|
|
|
|
1998-07-29 02:51:33 -04:00
|
|
|
Returns the minimum V position.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::GetVPosition}\label{wxjoystickgetvposition}
|
|
|
|
|
|
|
|
\constfunc{int}{GetVPosition}{\void}
|
|
|
|
|
|
|
|
Gets the position of the sixth axis of the joystick, if it exists.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetXMax}\label{wxjoystickgetxmax}
|
|
|
|
|
|
|
|
\constfunc{int}{GetXMax}{\void}
|
|
|
|
|
|
|
|
Returns the maximum x position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetXMin}\label{wxjoystickgetxmin}
|
|
|
|
|
|
|
|
\constfunc{int}{GetXMin}{\void}
|
|
|
|
|
|
|
|
Returns the minimum x position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetYMax}\label{wxjoystickgetymax}
|
|
|
|
|
|
|
|
\constfunc{int}{GetYMax}{\void}
|
|
|
|
|
|
|
|
Returns the maximum y position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetYMin}\label{wxjoystickgetymin}
|
|
|
|
|
|
|
|
\constfunc{int}{GetYMin}{\void}
|
|
|
|
|
|
|
|
Returns the minimum y position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetZMax}\label{wxjoystickgetzmax}
|
|
|
|
|
|
|
|
\constfunc{int}{GetZMax}{\void}
|
|
|
|
|
|
|
|
Returns the maximum z position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetZMin}\label{wxjoystickgetzmin}
|
|
|
|
|
|
|
|
\constfunc{int}{GetXMin}{\void}
|
|
|
|
|
|
|
|
Returns the minimum z position.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::GetZPosition}\label{wxjoystickgetzposition}
|
|
|
|
|
|
|
|
\constfunc{int}{GetZPosition}{\void}
|
|
|
|
|
|
|
|
Returns the z position of the joystick.
|
|
|
|
|
|
|
|
\membersection{wxJoystick::HasPOV}\label{wxjoystickhaspov}
|
|
|
|
|
|
|
|
\constfunc{bool}{HasPOV}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the joystick has a point of view control.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::HasPOV4Dir}\label{wxjoystickhaspovfdir}
|
|
|
|
|
|
|
|
\constfunc{bool}{HasPOV4Dir}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::HasPOVCTS}\label{wxjoystickhaspovcts}
|
|
|
|
|
|
|
|
\constfunc{bool}{HasPOVCTS}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the joystick point-of-view supports continuous degree bearings.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::HasRudder}\label{wxjoystickhasrudder}
|
|
|
|
|
|
|
|
\constfunc{bool}{HasRudder}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if there is a rudder attached to the computer.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::HasU}\label{wxjoystickhasu}
|
|
|
|
|
|
|
|
\constfunc{bool}{HasU}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the joystick has a U axis.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::HasV}\label{wxjoystickhasv}
|
|
|
|
|
|
|
|
\constfunc{bool}{HasV}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the joystick has a V axis.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::HasZ}\label{wxjoystickhasz}
|
|
|
|
|
|
|
|
\constfunc{bool}{HasZ}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the joystick has a Z axis.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::IsOk}\label{wxjoystickisok}
|
|
|
|
|
|
|
|
\constfunc{bool}{IsOk}{\void}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
Returns true if the joystick is functioning.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\membersection{wxJoystick::ReleaseCapture}\label{wxjoystickreleasecapture}
|
|
|
|
|
|
|
|
\func{bool}{ReleaseCapture}{\void}
|
|
|
|
|
|
|
|
Releases the capture set by {\bf SetCapture}.
|
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
true if the capture release succeeded.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxJoystick::SetCapture}{wxjoysticksetcapture}, \helpref{wxJoystickEvent}{wxjoystickevent}
|
|
|
|
|
|
|
|
\membersection{wxJoystick::SetCapture}\label{wxjoysticksetcapture}
|
|
|
|
|
|
|
|
\func{bool}{SetCapture}{\param{wxWindow*}{ win}, \param{int}{ pollingFreq = 0}}
|
|
|
|
|
|
|
|
Sets the capture to direct joystick events to {\it win}.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{win}{The window that will receive joystick events.}
|
|
|
|
|
|
|
|
\docparam{pollingFreq}{If zero, movement events are sent when above the
|
|
|
|
threshold. If greater than zero, events are received every {\it pollingFreq} milliseconds.}
|
|
|
|
|
|
|
|
\wxheading{Return value}
|
|
|
|
|
2003-01-17 19:16:34 -05:00
|
|
|
true if the capture succeeded.
|
1998-06-14 16:48:39 -04:00
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxJoystick::ReleaseCapture}{wxjoystickreleasecapture}, \helpref{wxJoystickEvent}{wxjoystickevent}
|
|
|
|
|
|
|
|
\membersection{wxJoystick::SetMovementThreshold}\label{wxjoysticksetmovementthreshold}
|
|
|
|
|
|
|
|
\func{void}{SetMovementThreshold}{\param{int}{ threshold}}
|
|
|
|
|
|
|
|
Sets the movement threshold, the number of steps outside which the joystick is deemed to have
|
|
|
|
moved.
|
|
|
|
|
|
|
|
|