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