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 \constfunc{bool
}{GetButtonState
}{\param{unsigned
}{ id
}}
44 Returns the state of the specified joystick button.
46 \wxheading{Parameters
}
48 \docparam{id
}{The button id to
report, from
0 to
\helpref{GetNumberButtons()
}{wxjoystickgetnumberbuttons
} -
1}
50 \membersection{wxJoystick::GetManufacturerId
}\label{wxjoystickgetmanufacturerid
}
52 \constfunc{int
}{GetManufacturerId
}{\void}
54 Returns the manufacturer id.
56 \membersection{wxJoystick::GetMovementThreshold
}\label{wxjoystickgetmovementthreshold
}
58 \constfunc{int
}{GetMovementThreshold
}{\void}
60 Returns the movement threshold, the number of steps outside which the joystick is deemed to have
63 \membersection{wxJoystick::GetNumberAxes
}\label{wxjoystickgetnumberaxes
}
65 \constfunc{int
}{GetNumberAxes
}{\void}
67 Returns the number of axes for this joystick.
69 \membersection{wxJoystick::GetNumberButtons
}\label{wxjoystickgetnumberbuttons
}
71 \constfunc{int
}{GetNumberButtons
}{\void}
73 Returns the number of buttons for this joystick.
75 \membersection{wxJoystick::GetNumberJoysticks
}\label{wxjoystickgetnumberjoysticks
}
77 \func{static int
}{GetNumberJoysticks
}{\void}
79 Returns the number of joysticks currently attached to the computer.
81 \membersection{wxJoystick::GetPollingMax
}\label{wxjoystickgetpollingmax
}
83 \constfunc{int
}{GetPollingMax
}{\void}
85 Returns the maximum polling frequency.
87 \membersection{wxJoystick::GetPollingMin
}\label{wxjoystickgetpollingmin
}
89 \constfunc{int
}{GetPollingMin
}{\void}
91 Returns the minimum polling frequency.
93 \membersection{wxJoystick::GetProductId
}\label{wxjoystickgetproductid
}
95 \constfunc{int
}{GetProductId
}{\void}
97 Returns the product id for the joystick.
99 \membersection{wxJoystick::GetProductName
}\label{wxjoystickgetproductname
}
101 \constfunc{wxString
}{GetProductName
}{\void}
103 Returns the product name for the joystick.
105 \membersection{wxJoystick::GetPosition
}\label{wxjoystickgetposition
}
107 \constfunc{wxPoint
}{GetPosition
}{\void}
109 Returns the x, y position of the joystick.
111 \constfunc{int
}{GetPosition
}{\param{unsigned
}{ axis
}}
113 Returns the position of the specified joystick axis.
115 \wxheading{Parameters
}
117 \docparam{axis
}{The joystick axis to
report, from
0 to
\helpref{GetNumberAxes()
}{wxjoystickgetnumberaxes
} -
1.
}
119 \membersection{wxJoystick::GetPOVPosition
}\label{wxjoystickgetpovposition
}
121 \constfunc{int
}{GetPOVPosition
}{\void}
123 Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units,
124 but limited to return
0,
9000,
18000 or
27000.
127 \membersection{wxJoystick::GetPOVCTSPosition
}\label{wxjoystickgetpovctsposition
}
129 \constfunc{int
}{GetPOVCTSPosition
}{\void}
131 Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units.
134 \membersection{wxJoystick::GetRudderMax
}\label{wxjoystickgetruddermax
}
136 \constfunc{int
}{GetRudderMax
}{\void}
138 Returns the maximum rudder position.
140 \membersection{wxJoystick::GetRudderMin
}\label{wxjoystickgetruddermin
}
142 \constfunc{int
}{GetRudderMin
}{\void}
144 Returns the minimum rudder position.
146 \membersection{wxJoystick::GetRudderPosition
}\label{wxjoystickgetrudderposition
}
148 \constfunc{int
}{GetRudderPosition
}{\void}
150 Returns the rudder position.
152 \membersection{wxJoystick::GetUMax
}\label{wxjoystickgetumax
}
154 \constfunc{int
}{GetUMax
}{\void}
156 Returns the maximum U position.
158 \membersection{wxJoystick::GetUMin
}\label{wxjoystickgetumin
}
160 \constfunc{int
}{GetUMin
}{\void}
162 Returns the minimum U position.
164 \membersection{wxJoystick::GetUPosition
}\label{wxjoystickgetuposition
}
166 \constfunc{int
}{GetUPosition
}{\void}
168 Gets the position of the fifth axis of the joystick, if it exists.
170 \membersection{wxJoystick::GetVMax
}\label{wxjoystickgetvmax
}
172 \constfunc{int
}{GetVMax
}{\void}
174 Returns the maximum V position.
176 \membersection{wxJoystick::GetVMin
}\label{wxjoystickgetvmin
}
178 \constfunc{int
}{GetVMin
}{\void}
180 Returns the minimum V position.
182 \membersection{wxJoystick::GetVPosition
}\label{wxjoystickgetvposition
}
184 \constfunc{int
}{GetVPosition
}{\void}
186 Gets the position of the sixth axis of the joystick, if it exists.
188 \membersection{wxJoystick::GetXMax
}\label{wxjoystickgetxmax
}
190 \constfunc{int
}{GetXMax
}{\void}
192 Returns the maximum x position.
194 \membersection{wxJoystick::GetXMin
}\label{wxjoystickgetxmin
}
196 \constfunc{int
}{GetXMin
}{\void}
198 Returns the minimum x position.
200 \membersection{wxJoystick::GetYMax
}\label{wxjoystickgetymax
}
202 \constfunc{int
}{GetYMax
}{\void}
204 Returns the maximum y position.
206 \membersection{wxJoystick::GetYMin
}\label{wxjoystickgetymin
}
208 \constfunc{int
}{GetYMin
}{\void}
210 Returns the minimum y position.
212 \membersection{wxJoystick::GetZMax
}\label{wxjoystickgetzmax
}
214 \constfunc{int
}{GetZMax
}{\void}
216 Returns the maximum z position.
218 \membersection{wxJoystick::GetZMin
}\label{wxjoystickgetzmin
}
220 \constfunc{int
}{GetZMin
}{\void}
222 Returns the minimum z position.
224 \membersection{wxJoystick::GetZPosition
}\label{wxjoystickgetzposition
}
226 \constfunc{int
}{GetZPosition
}{\void}
228 Returns the z position of the joystick.
230 \membersection{wxJoystick::HasPOV
}\label{wxjoystickhaspov
}
232 \constfunc{bool
}{HasPOV
}{\void}
234 Returns true if the joystick has a point of view control.
236 \membersection{wxJoystick::HasPOV4Dir
}\label{wxjoystickhaspovfdir
}
238 \constfunc{bool
}{HasPOV4Dir
}{\void}
240 Returns true if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).
242 \membersection{wxJoystick::HasPOVCTS
}\label{wxjoystickhaspovcts
}
244 \constfunc{bool
}{HasPOVCTS
}{\void}
246 Returns true if the joystick point-of-view supports continuous degree bearings.
248 \membersection{wxJoystick::HasRudder
}\label{wxjoystickhasrudder
}
250 \constfunc{bool
}{HasRudder
}{\void}
252 Returns true if there is a rudder attached to the computer.
254 \membersection{wxJoystick::HasU
}\label{wxjoystickhasu
}
256 \constfunc{bool
}{HasU
}{\void}
258 Returns true if the joystick has a U axis.
260 \membersection{wxJoystick::HasV
}\label{wxjoystickhasv
}
262 \constfunc{bool
}{HasV
}{\void}
264 Returns true if the joystick has a V axis.
266 \membersection{wxJoystick::HasZ
}\label{wxjoystickhasz
}
268 \constfunc{bool
}{HasZ
}{\void}
270 Returns true if the joystick has a Z axis.
272 \membersection{wxJoystick::IsOk
}\label{wxjoystickisok
}
274 \constfunc{bool
}{IsOk
}{\void}
276 Returns true if the joystick is functioning.
278 \membersection{wxJoystick::ReleaseCapture
}\label{wxjoystickreleasecapture
}
280 \func{bool
}{ReleaseCapture
}{\void}
282 Releases the capture set by
{\bf SetCapture
}.
284 \wxheading{Return value
}
286 true if the capture release succeeded.
290 \helpref{wxJoystick::SetCapture
}{wxjoysticksetcapture
},
\helpref{wxJoystickEvent
}{wxjoystickevent
}
292 \membersection{wxJoystick::SetCapture
}\label{wxjoysticksetcapture
}
294 \func{bool
}{SetCapture
}{\param{wxWindow*
}{ win
},
\param{int
}{ pollingFreq =
0}}
296 Sets the capture to direct joystick events to
{\it win
}.
298 \wxheading{Parameters
}
300 \docparam{win
}{The window that will receive joystick events.
}
302 \docparam{pollingFreq
}{If zero, movement events are sent when above the
303 threshold. If greater than zero, events are received every
{\it pollingFreq
} milliseconds.
}
305 \wxheading{Return value
}
307 true if the capture succeeded.
311 \helpref{wxJoystick::ReleaseCapture
}{wxjoystickreleasecapture
},
\helpref{wxJoystickEvent
}{wxjoystickevent
}
313 \membersection{wxJoystick::SetMovementThreshold
}\label{wxjoysticksetmovementthreshold
}
315 \func{void
}{SetMovementThreshold
}{\param{int
}{ threshold
}}
317 Sets the movement threshold, the number of steps outside which the joystick is deemed to have