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