]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/joystick.tex
updated SetFont() documentation: it returns bool, not void (bug 1705330)
[wxWidgets.git] / docs / latex / wx / joystick.tex
1 \section{\class{wxJoystick}}\label{wxjoystick}
2
3 wxJoystick allows an application to control one or more joysticks.
4
5 \wxheading{Derived from}
6
7 \helpref{wxObject}{wxobject}
8
9 \wxheading{Include files}
10
11 <wx/joystick.h>
12
13 \wxheading{See also}
14
15 \helpref{wxJoystickEvent}{wxjoystickevent}
16
17 \latexignore{\rtfignore{\wxheading{Members}}}
18
19 \membersection{wxJoystick::wxJoystick}\label{wxjoystickctor}
20
21 \func{}{wxJoystick}{\param{int}{ joystick = wxJOYSTICK1}}
22
23 Constructor. {\it joystick} may be one of wxJOYSTICK1, wxJOYSTICK2, indicating the joystick
24 controller of interest.
25
26 \membersection{wxJoystick::\destruct{wxJoystick}}\label{wxjoystickdtor}
27
28 \func{}{\destruct{wxJoystick}}{\void}
29
30 Destroys the wxJoystick object.
31
32 \membersection{wxJoystick::GetButtonState}\label{wxjoystickgetbuttonstate}
33
34 \constfunc{int}{GetButtonState}{\void}
35
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.
41
42 \constfunc{bool}{GetButtonState}{\param{unsigned}{ id}}
43
44 Returns the state of the specified joystick button.
45
46 \wxheading{Parameters}
47
48 \docparam{id}{The button id to report, from 0 to \helpref{GetNumberButtons()}{wxjoystickgetnumberbuttons} - 1}
49
50 \membersection{wxJoystick::GetManufacturerId}\label{wxjoystickgetmanufacturerid}
51
52 \constfunc{int}{GetManufacturerId}{\void}
53
54 Returns the manufacturer id.
55
56 \membersection{wxJoystick::GetMovementThreshold}\label{wxjoystickgetmovementthreshold}
57
58 \constfunc{int}{GetMovementThreshold}{\void}
59
60 Returns the movement threshold, the number of steps outside which the joystick is deemed to have
61 moved.
62
63 \membersection{wxJoystick::GetNumberAxes}\label{wxjoystickgetnumberaxes}
64
65 \constfunc{int}{GetNumberAxes}{\void}
66
67 Returns the number of axes for this joystick.
68
69 \membersection{wxJoystick::GetNumberButtons}\label{wxjoystickgetnumberbuttons}
70
71 \constfunc{int}{GetNumberButtons}{\void}
72
73 Returns the number of buttons for this joystick.
74
75 \membersection{wxJoystick::GetNumberJoysticks}\label{wxjoystickgetnumberjoysticks}
76
77 \func{static int}{GetNumberJoysticks}{\void}
78
79 Returns the number of joysticks currently attached to the computer.
80
81 \membersection{wxJoystick::GetPollingMax}\label{wxjoystickgetpollingmax}
82
83 \constfunc{int}{GetPollingMax}{\void}
84
85 Returns the maximum polling frequency.
86
87 \membersection{wxJoystick::GetPollingMin}\label{wxjoystickgetpollingmin}
88
89 \constfunc{int}{GetPollingMin}{\void}
90
91 Returns the minimum polling frequency.
92
93 \membersection{wxJoystick::GetProductId}\label{wxjoystickgetproductid}
94
95 \constfunc{int}{GetProductId}{\void}
96
97 Returns the product id for the joystick.
98
99 \membersection{wxJoystick::GetProductName}\label{wxjoystickgetproductname}
100
101 \constfunc{wxString}{GetProductName}{\void}
102
103 Returns the product name for the joystick.
104
105 \membersection{wxJoystick::GetPosition}\label{wxjoystickgetposition}
106
107 \constfunc{wxPoint}{GetPosition}{\void}
108
109 Returns the x, y position of the joystick.
110
111 \constfunc{int}{GetPosition}{\param{unsigned}{ axis}}
112
113 Returns the position of the specified joystick axis.
114
115 \wxheading{Parameters}
116
117 \docparam{axis}{The joystick axis to report, from 0 to \helpref{GetNumberAxes()}{wxjoystickgetnumberaxes} - 1.}
118
119 \membersection{wxJoystick::GetPOVPosition}\label{wxjoystickgetpovposition}
120
121 \constfunc{int}{GetPOVPosition}{\void}
122
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.
125 Returns -1 on error.
126
127 \membersection{wxJoystick::GetPOVCTSPosition}\label{wxjoystickgetpovctsposition}
128
129 \constfunc{int}{GetPOVCTSPosition}{\void}
130
131 Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units.
132 Returns -1 on error.
133
134 \membersection{wxJoystick::GetRudderMax}\label{wxjoystickgetruddermax}
135
136 \constfunc{int}{GetRudderMax}{\void}
137
138 Returns the maximum rudder position.
139
140 \membersection{wxJoystick::GetRudderMin}\label{wxjoystickgetruddermin}
141
142 \constfunc{int}{GetRudderMin}{\void}
143
144 Returns the minimum rudder position.
145
146 \membersection{wxJoystick::GetRudderPosition}\label{wxjoystickgetrudderposition}
147
148 \constfunc{int}{GetRudderPosition}{\void}
149
150 Returns the rudder position.
151
152 \membersection{wxJoystick::GetUMax}\label{wxjoystickgetumax}
153
154 \constfunc{int}{GetUMax}{\void}
155
156 Returns the maximum U position.
157
158 \membersection{wxJoystick::GetUMin}\label{wxjoystickgetumin}
159
160 \constfunc{int}{GetUMin}{\void}
161
162 Returns the minimum U position.
163
164 \membersection{wxJoystick::GetUPosition}\label{wxjoystickgetuposition}
165
166 \constfunc{int}{GetUPosition}{\void}
167
168 Gets the position of the fifth axis of the joystick, if it exists.
169
170 \membersection{wxJoystick::GetVMax}\label{wxjoystickgetvmax}
171
172 \constfunc{int}{GetVMax}{\void}
173
174 Returns the maximum V position.
175
176 \membersection{wxJoystick::GetVMin}\label{wxjoystickgetvmin}
177
178 \constfunc{int}{GetVMin}{\void}
179
180 Returns the minimum V position.
181
182 \membersection{wxJoystick::GetVPosition}\label{wxjoystickgetvposition}
183
184 \constfunc{int}{GetVPosition}{\void}
185
186 Gets the position of the sixth axis of the joystick, if it exists.
187
188 \membersection{wxJoystick::GetXMax}\label{wxjoystickgetxmax}
189
190 \constfunc{int}{GetXMax}{\void}
191
192 Returns the maximum x position.
193
194 \membersection{wxJoystick::GetXMin}\label{wxjoystickgetxmin}
195
196 \constfunc{int}{GetXMin}{\void}
197
198 Returns the minimum x position.
199
200 \membersection{wxJoystick::GetYMax}\label{wxjoystickgetymax}
201
202 \constfunc{int}{GetYMax}{\void}
203
204 Returns the maximum y position.
205
206 \membersection{wxJoystick::GetYMin}\label{wxjoystickgetymin}
207
208 \constfunc{int}{GetYMin}{\void}
209
210 Returns the minimum y position.
211
212 \membersection{wxJoystick::GetZMax}\label{wxjoystickgetzmax}
213
214 \constfunc{int}{GetZMax}{\void}
215
216 Returns the maximum z position.
217
218 \membersection{wxJoystick::GetZMin}\label{wxjoystickgetzmin}
219
220 \constfunc{int}{GetZMin}{\void}
221
222 Returns the minimum z position.
223
224 \membersection{wxJoystick::GetZPosition}\label{wxjoystickgetzposition}
225
226 \constfunc{int}{GetZPosition}{\void}
227
228 Returns the z position of the joystick.
229
230 \membersection{wxJoystick::HasPOV}\label{wxjoystickhaspov}
231
232 \constfunc{bool}{HasPOV}{\void}
233
234 Returns true if the joystick has a point of view control.
235
236 \membersection{wxJoystick::HasPOV4Dir}\label{wxjoystickhaspovfdir}
237
238 \constfunc{bool}{HasPOV4Dir}{\void}
239
240 Returns true if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).
241
242 \membersection{wxJoystick::HasPOVCTS}\label{wxjoystickhaspovcts}
243
244 \constfunc{bool}{HasPOVCTS}{\void}
245
246 Returns true if the joystick point-of-view supports continuous degree bearings.
247
248 \membersection{wxJoystick::HasRudder}\label{wxjoystickhasrudder}
249
250 \constfunc{bool}{HasRudder}{\void}
251
252 Returns true if there is a rudder attached to the computer.
253
254 \membersection{wxJoystick::HasU}\label{wxjoystickhasu}
255
256 \constfunc{bool}{HasU}{\void}
257
258 Returns true if the joystick has a U axis.
259
260 \membersection{wxJoystick::HasV}\label{wxjoystickhasv}
261
262 \constfunc{bool}{HasV}{\void}
263
264 Returns true if the joystick has a V axis.
265
266 \membersection{wxJoystick::HasZ}\label{wxjoystickhasz}
267
268 \constfunc{bool}{HasZ}{\void}
269
270 Returns true if the joystick has a Z axis.
271
272 \membersection{wxJoystick::IsOk}\label{wxjoystickisok}
273
274 \constfunc{bool}{IsOk}{\void}
275
276 Returns true if the joystick is functioning.
277
278 \membersection{wxJoystick::ReleaseCapture}\label{wxjoystickreleasecapture}
279
280 \func{bool}{ReleaseCapture}{\void}
281
282 Releases the capture set by {\bf SetCapture}.
283
284 \wxheading{Return value}
285
286 true if the capture release succeeded.
287
288 \wxheading{See also}
289
290 \helpref{wxJoystick::SetCapture}{wxjoysticksetcapture}, \helpref{wxJoystickEvent}{wxjoystickevent}
291
292 \membersection{wxJoystick::SetCapture}\label{wxjoysticksetcapture}
293
294 \func{bool}{SetCapture}{\param{wxWindow*}{ win}, \param{int}{ pollingFreq = 0}}
295
296 Sets the capture to direct joystick events to {\it win}.
297
298 \wxheading{Parameters}
299
300 \docparam{win}{The window that will receive joystick events.}
301
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.}
304
305 \wxheading{Return value}
306
307 true if the capture succeeded.
308
309 \wxheading{See also}
310
311 \helpref{wxJoystick::ReleaseCapture}{wxjoystickreleasecapture}, \helpref{wxJoystickEvent}{wxjoystickevent}
312
313 \membersection{wxJoystick::SetMovementThreshold}\label{wxjoysticksetmovementthreshold}
314
315 \func{void}{SetMovementThreshold}{\param{int}{ threshold}}
316
317 Sets the movement threshold, the number of steps outside which the joystick is deemed to have
318 moved.
319
320