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