File: wx122.htm

package info (click to toggle)
wxwin2-doc 2.01-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,540 kB
  • ctags: 5,968
  • sloc: cpp: 15,157; makefile: 434; sh: 6
file content (377 lines) | stat: -rw-r--r-- 12,216 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
<HTML>
<head><title>wxJoystick</title></head>

<BODY BGCOLOR=#FFFFFF>
<A NAME="wxjoystick"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx121.htm#wxipv4address"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx123.htm#wxjoystickevent"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>

<H2>wxJoystick</H2>
<P>
wxJoystick allows an application to control one or more joysticks.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
&lt;wx/joystick.h&gt;<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx123.htm#wxjoystickevent">wxJoystickEvent</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxjoystickconstr">wxJoystick::wxJoystick</A><BR>
<A HREF="#topic493">wxJoystick::~wxJoystick</A><BR>
<A HREF="#wxjoystickgetbuttonstate">wxJoystick::GetButtonState</A><BR>
<A HREF="#wxjoystickgetmanufacturerid">wxJoystick::GetManufacturerId</A><BR>
<A HREF="#wxjoystickgetmovementthreshold">wxJoystick::GetMovementThreshold</A><BR>
<A HREF="#wxjoystickgetnumberaxes">wxJoystick::GetNumberAxes</A><BR>
<A HREF="#wxjoystickgetnumberbuttons">wxJoystick::GetNumberButtons</A><BR>
<A HREF="#wxjoystickgetnumberjoysticks">wxJoystick::GetNumberJoysticks</A><BR>
<A HREF="#wxjoystickgetpollingmax">wxJoystick::GetPollingMax</A><BR>
<A HREF="#wxjoystickgetpollingmin">wxJoystick::GetPollingMin</A><BR>
<A HREF="#wxjoystickgetproductid">wxJoystick::GetProductId</A><BR>
<A HREF="#wxjoystickgetproductname">wxJoystick::GetProductName</A><BR>
<A HREF="#wxjoystickgetposition">wxJoystick::GetPosition</A><BR>
<A HREF="#wxjoystickgetpovposition">wxJoystick::GetPOVPosition</A><BR>
<A HREF="#wxjoystickgetpovctsposition">wxJoystick::GetPOVCTSPosition</A><BR>
<A HREF="#wxjoystickgetruddermax">wxJoystick::GetRudderMax</A><BR>
<A HREF="#wxjoystickgetruddermin">wxJoystick::GetRudderMin</A><BR>
<A HREF="#wxjoystickgetrudderposition">wxJoystick::GetRudderPosition</A><BR>
<A HREF="#wxjoystickgetumax">wxJoystick::GetUMax</A><BR>
<A HREF="#wxjoystickgetumin">wxJoystick::GetUMin</A><BR>
<A HREF="#wxjoystickgetuposition">wxJoystick::GetUPosition</A><BR>
<A HREF="#wxjoystickgetvmax">wxJoystick::GetVMax</A><BR>
<A HREF="#wxjoystickgetvmin">wxJoystick::GetVMin</A><BR>
<A HREF="#wxjoystickgetvposition">wxJoystick::GetVPosition</A><BR>
<A HREF="#wxjoystickgetxmax">wxJoystick::GetXMax</A><BR>
<A HREF="#wxjoystickgetxmin">wxJoystick::GetXMin</A><BR>
<A HREF="#wxjoystickgetymax">wxJoystick::GetYMax</A><BR>
<A HREF="#wxjoystickgetymin">wxJoystick::GetYMin</A><BR>
<A HREF="#wxjoystickgetzmax">wxJoystick::GetZMax</A><BR>
<A HREF="#wxjoystickgetzmin">wxJoystick::GetZMin</A><BR>
<A HREF="#wxjoystickgetzposition">wxJoystick::GetZPosition</A><BR>
<A HREF="#wxjoystickhaspov">wxJoystick::HasPOV</A><BR>
<A HREF="#wxjoystickhaspovfdir">wxJoystick::HasPOV4Dir</A><BR>
<A HREF="#wxjoystickhaspovcts">wxJoystick::HasPOVCTS</A><BR>
<A HREF="#wxjoystickhasrudder">wxJoystick::HasRudder</A><BR>
<A HREF="#wxjoystickhasu">wxJoystick::HasU</A><BR>
<A HREF="#wxjoystickhasv">wxJoystick::HasV</A><BR>
<A HREF="#wxjoystickhasz">wxJoystick::HasZ</A><BR>
<A HREF="#wxjoystickisok">wxJoystick::IsOk</A><BR>
<A HREF="#wxjoystickreleasecapture">wxJoystick::ReleaseCapture</A><BR>
<A HREF="#wxjoysticksetcapture">wxJoystick::SetCapture</A><BR>
<A HREF="#wxjoysticksetmovementthreshold">wxJoystick::SetMovementThreshold</A><BR>
<P>

<HR>
<A NAME="wxjoystickconstr"></A>
<H3>wxJoystick::wxJoystick</H3>
<P>
<B></B> <B>wxJoystick</B>(<B>int</B><I> joystick = wxJOYSTICK1</I>)<P>
Constructor. <I>joystick</I> may be one of wxJOYSTICK1, wxJOYSTICK2, indicating the joystick
controller of interest.<P>

<HR>
<A NAME="topic493"></A>
<H3>wxJoystick::~wxJoystick</H3>
<P>
<B></B> <B>~wxJoystick</B>()<P>
Destroys the wxJoystick object.<P>

<HR>
<A NAME="wxjoystickgetbuttonstate"></A>
<H3>wxJoystick::GetButtonState</H3>
<P>
<B>int</B> <B>GetButtonState</B>() <B>const</B><P>
Returns the state of the joystick buttons. A bitlist of wxJOY_BUTTONn identifiers,
where n is 1, 2, 3 or 4.<P>

<HR>
<A NAME="wxjoystickgetmanufacturerid"></A>
<H3>wxJoystick::GetManufacturerId</H3>
<P>
<B>int</B> <B>GetManufacturerId</B>() <B>const</B><P>
Returns the manufacturer id.<P>

<HR>
<A NAME="wxjoystickgetmovementthreshold"></A>
<H3>wxJoystick::GetMovementThreshold</H3>
<P>
<B>int</B> <B>GetMovementThreshold</B>() <B>const</B><P>
Returns the movement threshold, the number of steps outside which the joystick is deemed to have
moved.<P>

<HR>
<A NAME="wxjoystickgetnumberaxes"></A>
<H3>wxJoystick::GetNumberAxes</H3>
<P>
<B>int</B> <B>GetNumberAxes</B>() <B>const</B><P>
Returns the number of axes for this joystick.<P>

<HR>
<A NAME="wxjoystickgetnumberbuttons"></A>
<H3>wxJoystick::GetNumberButtons</H3>
<P>
<B>int</B> <B>GetNumberButtons</B>() <B>const</B><P>
Returns the number of buttons for this joystick.<P>

<HR>
<A NAME="wxjoystickgetnumberjoysticks"></A>
<H3>wxJoystick::GetNumberJoysticks</H3>
<P>
<B>int</B> <B>GetNumberJoysticks</B>() <B>const</B><P>
Returns the number of joysticks currently attached to the computer.<P>

<HR>
<A NAME="wxjoystickgetpollingmax"></A>
<H3>wxJoystick::GetPollingMax</H3>
<P>
<B>int</B> <B>GetPollingMax</B>() <B>const</B><P>
Returns the maximum polling frequency.<P>

<HR>
<A NAME="wxjoystickgetpollingmin"></A>
<H3>wxJoystick::GetPollingMin</H3>
<P>
<B>int</B> <B>GetPollingMin</B>() <B>const</B><P>
Returns the minimum polling frequency.<P>

<HR>
<A NAME="wxjoystickgetproductid"></A>
<H3>wxJoystick::GetProductId</H3>
<P>
<B>int</B> <B>GetProductId</B>() <B>const</B><P>
Returns the product id for the joystick.<P>

<HR>
<A NAME="wxjoystickgetproductname"></A>
<H3>wxJoystick::GetProductName</H3>
<P>
<B>wxString</B> <B>GetProductName</B>() <B>const</B><P>
Returns the product name for the joystick.<P>

<HR>
<A NAME="wxjoystickgetposition"></A>
<H3>wxJoystick::GetPosition</H3>
<P>
<B>wxPoint</B> <B>GetPosition</B>() <B>const</B><P>
Returns the x, y position of the joystick.<P>

<HR>
<A NAME="wxjoystickgetpovposition"></A>
<H3>wxJoystick::GetPOVPosition</H3>
<P>
<B>int</B> <B>GetPOVPosition</B>() <B>const</B><P>
Returns the point-of-view position, expressed in discrete units.<P>

<HR>
<A NAME="wxjoystickgetpovctsposition"></A>
<H3>wxJoystick::GetPOVCTSPosition</H3>
<P>
<B>int</B> <B>GetPOVCTSPosition</B>() <B>const</B><P>
Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units.<P>

<HR>
<A NAME="wxjoystickgetruddermax"></A>
<H3>wxJoystick::GetRudderMax</H3>
<P>
<B>int</B> <B>GetRudderMax</B>() <B>const</B><P>
Returns the maximum rudder position.<P>

<HR>
<A NAME="wxjoystickgetruddermin"></A>
<H3>wxJoystick::GetRudderMin</H3>
<P>
<B>int</B> <B>GetRudderMin</B>() <B>const</B><P>
Returns the minimum rudder position.<P>

<HR>
<A NAME="wxjoystickgetrudderposition"></A>
<H3>wxJoystick::GetRudderPosition</H3>
<P>
<B>int</B> <B>GetRudderPosition</B>() <B>const</B><P>
Returns the rudder position.<P>

<HR>
<A NAME="wxjoystickgetumax"></A>
<H3>wxJoystick::GetUMax</H3>
<P>
<B>int</B> <B>GetUMax</B>() <B>const</B><P>
Returns the maximum U position.<P>

<HR>
<A NAME="wxjoystickgetumin"></A>
<H3>wxJoystick::GetUMin</H3>
<P>
<B>int</B> <B>GetUMin</B>() <B>const</B><P>
Returns the minimum U position.<P>

<HR>
<A NAME="wxjoystickgetuposition"></A>
<H3>wxJoystick::GetUPosition</H3>
<P>
<B>int</B> <B>GetUPosition</B>() <B>const</B><P>
Gets the position of the fifth axis of the joystick, if it exists.<P>

<HR>
<A NAME="wxjoystickgetvmax"></A>
<H3>wxJoystick::GetVMax</H3>
<P>
<B>int</B> <B>GetVMax</B>() <B>const</B><P>
Returns the maximum V position.<P>

<HR>
<A NAME="wxjoystickgetvmin"></A>
<H3>wxJoystick::GetVMin</H3>
<P>
<B>int</B> <B>GetVMin</B>() <B>const</B><P>
Returns the minimum V position.<P>

<HR>
<A NAME="wxjoystickgetvposition"></A>
<H3>wxJoystick::GetVPosition</H3>
<P>
<B>int</B> <B>GetVPosition</B>() <B>const</B><P>
Gets the position of the sixth axis of the joystick, if it exists.<P>

<HR>
<A NAME="wxjoystickgetxmax"></A>
<H3>wxJoystick::GetXMax</H3>
<P>
<B>int</B> <B>GetXMax</B>() <B>const</B><P>
Returns the maximum x position.<P>

<HR>
<A NAME="wxjoystickgetxmin"></A>
<H3>wxJoystick::GetXMin</H3>
<P>
<B>int</B> <B>GetXMin</B>() <B>const</B><P>
Returns the minimum x position.<P>

<HR>
<A NAME="wxjoystickgetymax"></A>
<H3>wxJoystick::GetYMax</H3>
<P>
<B>int</B> <B>GetYMax</B>() <B>const</B><P>
Returns the maximum y position.<P>

<HR>
<A NAME="wxjoystickgetymin"></A>
<H3>wxJoystick::GetYMin</H3>
<P>
<B>int</B> <B>GetYMin</B>() <B>const</B><P>
Returns the minimum y position.<P>

<HR>
<A NAME="wxjoystickgetzmax"></A>
<H3>wxJoystick::GetZMax</H3>
<P>
<B>int</B> <B>GetZMax</B>() <B>const</B><P>
Returns the maximum z position.<P>

<HR>
<A NAME="wxjoystickgetzmin"></A>
<H3>wxJoystick::GetZMin</H3>
<P>
<B>int</B> <B>GetXMin</B>() <B>const</B><P>
Returns the minimum z position.<P>

<HR>
<A NAME="wxjoystickgetzposition"></A>
<H3>wxJoystick::GetZPosition</H3>
<P>
<B>int</B> <B>GetZPosition</B>() <B>const</B><P>
Returns the z position of the joystick.<P>

<HR>
<A NAME="wxjoystickhaspov"></A>
<H3>wxJoystick::HasPOV</H3>
<P>
<B>bool</B> <B>HasPOV</B>() <B>const</B><P>
Returns TRUE if the joystick has a point of view control.<P>

<HR>
<A NAME="wxjoystickhaspovfdir"></A>
<H3>wxJoystick::HasPOV4Dir</H3>
<P>
<B>bool</B> <B>HasPOV4Dir</B>() <B>const</B><P>
Returns TRUE if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).<P>

<HR>
<A NAME="wxjoystickhaspovcts"></A>
<H3>wxJoystick::HasPOVCTS</H3>
<P>
<B>bool</B> <B>HasPOVCTS</B>() <B>const</B><P>
Returns TRUE if the joystick point-of-view supports continuous degree bearings.<P>

<HR>
<A NAME="wxjoystickhasrudder"></A>
<H3>wxJoystick::HasRudder</H3>
<P>
<B>bool</B> <B>HasRudder</B>() <B>const</B><P>
Returns TRUE if there is a rudder attached to the computer.<P>

<HR>
<A NAME="wxjoystickhasu"></A>
<H3>wxJoystick::HasU</H3>
<P>
<B>bool</B> <B>HasU</B>() <B>const</B><P>
Returns TRUE if the joystick has a U axis.<P>

<HR>
<A NAME="wxjoystickhasv"></A>
<H3>wxJoystick::HasV</H3>
<P>
<B>bool</B> <B>HasV</B>() <B>const</B><P>
Returns TRUE if the joystick has a V axis.<P>

<HR>
<A NAME="wxjoystickhasz"></A>
<H3>wxJoystick::HasZ</H3>
<P>
<B>bool</B> <B>HasZ</B>() <B>const</B><P>
Returns TRUE if the joystick has a Z axis.<P>

<HR>
<A NAME="wxjoystickisok"></A>
<H3>wxJoystick::IsOk</H3>
<P>
<B>bool</B> <B>IsOk</B>() <B>const</B><P>
Returns TRUE if the joystick is functioning.<P>

<HR>
<A NAME="wxjoystickreleasecapture"></A>
<H3>wxJoystick::ReleaseCapture</H3>
<P>
<B>bool</B> <B>ReleaseCapture</B>()<P>
Releases the capture set by <B>SetCapture</B>.<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
TRUE if the capture release succeeded.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx122.htm#wxjoysticksetcapture">wxJoystick::SetCapture</A>, <A HREF="wx123.htm#wxjoystickevent">wxJoystickEvent</A><P>

<HR>
<A NAME="wxjoysticksetcapture"></A>
<H3>wxJoystick::SetCapture</H3>
<P>
<B>bool</B> <B>SetCapture</B>(<B>wxWindow*</B><I> win</I>, <B>int</B><I> pollingFreq = 0</I>)<P>
Sets the capture to direct joystick events to <I>win</I>.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>win</I><UL><UL>
The window that will receive joystick events.</UL></UL>
<P>
<I>pollingFreq</I><UL><UL>
If zero, movement events are sent when above the
threshold. If greater than zero, events are received every <I>pollingFreq</I> milliseconds.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
TRUE if the capture succeeded.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx122.htm#wxjoystickreleasecapture">wxJoystick::ReleaseCapture</A>, <A HREF="wx123.htm#wxjoystickevent">wxJoystickEvent</A><P>

<HR>
<A NAME="wxjoysticksetmovementthreshold"></A>
<H3>wxJoystick::SetMovementThreshold</H3>
<P>
<B>void</B> <B>SetMovementThreshold</B>(<B>int</B><I> threshold</I>)<P>
Sets the movement threshold, the number of steps outside which the joystick is deemed to have
moved.<P>


</BODY></HTML>