1 \section{\class{wxJoystick
}}\label{wxjoystick
}
3 wxJoystick allows an application to control one or more joysticks.
5 \wxheading{Derived from
}
7 \helpref{wxObject
}{wxobject
}
9 \wxheading{Include files
}
15 \helpref{wxJoystickEvent
}{wxjoystickevent
}
17 \latexignore{\rtfignore{\wxheading{Members
}}}
19 \membersection{wxJoystick::wxJoystick
}\label{wxjoystickctor
}
21 \func{}{wxJoystick
}{\param{int
}{ joystick = wxJOYSTICK1
}}
23 Constructor.
{\it joystick
} may be one of wxJOYSTICK1, wxJOYSTICK2, indicating the joystick
24 controller of interest.
26 \membersection{wxJoystick::
\destruct{wxJoystick
}}\label{wxjoystickdtor
}
28 \func{}{\destruct{wxJoystick
}}{\void}
30 Destroys the wxJoystick object.
32 \membersection{wxJoystick::GetButtonState
}\label{wxjoystickgetbuttonstate
}
34 \constfunc{int
}{GetButtonState
}{\void}
36 Returns the state of the joystick buttons. Every button is mapped to a single
37 bit in the returned integer, with the first button being mapped to the least
38 significant bit, and so on.
39 A bitlist of wxJOY
\_BUTTONn identifiers, where n is
1,
2,
3 or
4
40 is available for historical reasons.
42 \membersection{wxJoystick::GetManufacturerId
}\label{wxjoystickgetmanufacturerid
}
44 \constfunc{int
}{GetManufacturerId
}{\void}
46 Returns the manufacturer id.
48 \membersection{wxJoystick::GetMovementThreshold
}\label{wxjoystickgetmovementthreshold
}
50 \constfunc{int
}{GetMovementThreshold
}{\void}
52 Returns the movement threshold, the number of steps outside which the joystick is deemed to have
55 \membersection{wxJoystick::GetNumberAxes
}\label{wxjoystickgetnumberaxes
}
57 \constfunc{int
}{GetNumberAxes
}{\void}
59 Returns the number of axes for this joystick.
61 \membersection{wxJoystick::GetNumberButtons
}\label{wxjoystickgetnumberbuttons
}
63 \constfunc{int
}{GetNumberButtons
}{\void}
65 Returns the number of buttons for this joystick.
67 \membersection{wxJoystick::GetNumberJoysticks
}\label{wxjoystickgetnumberjoysticks
}
69 \constfunc{int
}{GetNumberJoysticks
}{\void}
71 Returns the number of joysticks currently attached to the computer.
73 \membersection{wxJoystick::GetPollingMax
}\label{wxjoystickgetpollingmax
}
75 \constfunc{int
}{GetPollingMax
}{\void}
77 Returns the maximum polling frequency.
79 \membersection{wxJoystick::GetPollingMin
}\label{wxjoystickgetpollingmin
}
81 \constfunc{int
}{GetPollingMin
}{\void}
83 Returns the minimum polling frequency.
85 \membersection{wxJoystick::GetProductId
}\label{wxjoystickgetproductid
}
87 \constfunc{int
}{GetProductId
}{\void}
89 Returns the product id for the joystick.
91 \membersection{wxJoystick::GetProductName
}\label{wxjoystickgetproductname
}
93 \constfunc{wxString
}{GetProductName
}{\void}
95 Returns the product name for the joystick.
97 \membersection{wxJoystick::GetPosition
}\label{wxjoystickgetposition
}
99 \constfunc{wxPoint
}{GetPosition
}{\void}
101 Returns the x, y position of the joystick.
103 \membersection{wxJoystick::GetPOVPosition
}\label{wxjoystickgetpovposition
}
105 \constfunc{int
}{GetPOVPosition
}{\void}
107 Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units,
108 but limited to return
0,
9000,
18000 or
27000.
111 \membersection{wxJoystick::GetPOVCTSPosition
}\label{wxjoystickgetpovctsposition
}
113 \constfunc{int
}{GetPOVCTSPosition
}{\void}
115 Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units.
118 \membersection{wxJoystick::GetRudderMax
}\label{wxjoystickgetruddermax
}
120 \constfunc{int
}{GetRudderMax
}{\void}
122 Returns the maximum rudder position.
124 \membersection{wxJoystick::GetRudderMin
}\label{wxjoystickgetruddermin
}
126 \constfunc{int
}{GetRudderMin
}{\void}
128 Returns the minimum rudder position.
130 \membersection{wxJoystick::GetRudderPosition
}\label{wxjoystickgetrudderposition
}
132 \constfunc{int
}{GetRudderPosition
}{\void}
134 Returns the rudder position.
136 \membersection{wxJoystick::GetUMax
}\label{wxjoystickgetumax
}
138 \constfunc{int
}{GetUMax
}{\void}
140 Returns the maximum U position.
142 \membersection{wxJoystick::GetUMin
}\label{wxjoystickgetumin
}
144 \constfunc{int
}{GetUMin
}{\void}
146 Returns the minimum U position.
148 \membersection{wxJoystick::GetUPosition
}\label{wxjoystickgetuposition
}
150 \constfunc{int
}{GetUPosition
}{\void}
152 Gets the position of the fifth axis of the joystick, if it exists.
154 \membersection{wxJoystick::GetVMax
}\label{wxjoystickgetvmax
}
156 \constfunc{int
}{GetVMax
}{\void}
158 Returns the maximum V position.
160 \membersection{wxJoystick::GetVMin
}\label{wxjoystickgetvmin
}
162 \constfunc{int
}{GetVMin
}{\void}
164 Returns the minimum V position.
166 \membersection{wxJoystick::GetVPosition
}\label{wxjoystickgetvposition
}
168 \constfunc{int
}{GetVPosition
}{\void}
170 Gets the position of the sixth axis of the joystick, if it exists.
172 \membersection{wxJoystick::GetXMax
}\label{wxjoystickgetxmax
}
174 \constfunc{int
}{GetXMax
}{\void}
176 Returns the maximum x position.
178 \membersection{wxJoystick::GetXMin
}\label{wxjoystickgetxmin
}
180 \constfunc{int
}{GetXMin
}{\void}
182 Returns the minimum x position.
184 \membersection{wxJoystick::GetYMax
}\label{wxjoystickgetymax
}
186 \constfunc{int
}{GetYMax
}{\void}
188 Returns the maximum y position.
190 \membersection{wxJoystick::GetYMin
}\label{wxjoystickgetymin
}
192 \constfunc{int
}{GetYMin
}{\void}
194 Returns the minimum y position.
196 \membersection{wxJoystick::GetZMax
}\label{wxjoystickgetzmax
}
198 \constfunc{int
}{GetZMax
}{\void}
200 Returns the maximum z position.
202 \membersection{wxJoystick::GetZMin
}\label{wxjoystickgetzmin
}
204 \constfunc{int
}{GetZMin
}{\void}
206 Returns the minimum z position.
208 \membersection{wxJoystick::GetZPosition
}\label{wxjoystickgetzposition
}
210 \constfunc{int
}{GetZPosition
}{\void}
212 Returns the z position of the joystick.
214 \membersection{wxJoystick::HasPOV
}\label{wxjoystickhaspov
}
216 \constfunc{bool
}{HasPOV
}{\void}
218 Returns true if the joystick has a point of view control.
220 \membersection{wxJoystick::HasPOV4Dir
}\label{wxjoystickhaspovfdir
}
222 \constfunc{bool
}{HasPOV4Dir
}{\void}
224 Returns true if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).
226 \membersection{wxJoystick::HasPOVCTS
}\label{wxjoystickhaspovcts
}
228 \constfunc{bool
}{HasPOVCTS
}{\void}
230 Returns true if the joystick point-of-view supports continuous degree bearings.
232 \membersection{wxJoystick::HasRudder
}\label{wxjoystickhasrudder
}
234 \constfunc{bool
}{HasRudder
}{\void}
236 Returns true if there is a rudder attached to the computer.
238 \membersection{wxJoystick::HasU
}\label{wxjoystickhasu
}
240 \constfunc{bool
}{HasU
}{\void}
242 Returns true if the joystick has a U axis.
244 \membersection{wxJoystick::HasV
}\label{wxjoystickhasv
}
246 \constfunc{bool
}{HasV
}{\void}
248 Returns true if the joystick has a V axis.
250 \membersection{wxJoystick::HasZ
}\label{wxjoystickhasz
}
252 \constfunc{bool
}{HasZ
}{\void}
254 Returns true if the joystick has a Z axis.
256 \membersection{wxJoystick::IsOk
}\label{wxjoystickisok
}
258 \constfunc{bool
}{IsOk
}{\void}
260 Returns true if the joystick is functioning.
262 \membersection{wxJoystick::ReleaseCapture
}\label{wxjoystickreleasecapture
}
264 \func{bool
}{ReleaseCapture
}{\void}
266 Releases the capture set by
{\bf SetCapture
}.
268 \wxheading{Return value
}
270 true if the capture release succeeded.
274 \helpref{wxJoystick::SetCapture
}{wxjoysticksetcapture
},
\helpref{wxJoystickEvent
}{wxjoystickevent
}
276 \membersection{wxJoystick::SetCapture
}\label{wxjoysticksetcapture
}
278 \func{bool
}{SetCapture
}{\param{wxWindow*
}{ win
},
\param{int
}{ pollingFreq =
0}}
280 Sets the capture to direct joystick events to
{\it win
}.
282 \wxheading{Parameters
}
284 \docparam{win
}{The window that will receive joystick events.
}
286 \docparam{pollingFreq
}{If zero, movement events are sent when above the
287 threshold. If greater than zero, events are received every
{\it pollingFreq
} milliseconds.
}
289 \wxheading{Return value
}
291 true if the capture succeeded.
295 \helpref{wxJoystick::ReleaseCapture
}{wxjoystickreleasecapture
},
\helpref{wxJoystickEvent
}{wxjoystickevent
}
297 \membersection{wxJoystick::SetMovementThreshold
}\label{wxjoysticksetmovementthreshold
}
299 \func{void
}{SetMovementThreshold
}{\param{int
}{ threshold
}}
301 Sets the movement threshold, the number of steps outside which the joystick is deemed to have