1 \section{\class{wxJoystick
}}\label{wxjoystick
}
3 wxJoystick allows an application to control one or more joysticks.
5 \wxheading{Derived from
}
7 \helpref{wxObject
}{wxobject
}
9 \wxheading{Include files
}
15 \helpref{wxAdv
}{librarieslist
}
19 \helpref{wxJoystickEvent
}{wxjoystickevent
}
21 \latexignore{\rtfignore{\wxheading{Members
}}}
23 \membersection{wxJoystick::wxJoystick
}\label{wxjoystickctor
}
25 \func{}{wxJoystick
}{\param{int
}{ joystick = wxJOYSTICK1
}}
27 Constructor.
{\it joystick
} may be one of wxJOYSTICK1, wxJOYSTICK2, indicating the joystick
28 controller of interest.
30 \membersection{wxJoystick::
\destruct{wxJoystick
}}\label{wxjoystickdtor
}
32 \func{}{\destruct{wxJoystick
}}{\void}
34 Destroys the wxJoystick object.
36 \membersection{wxJoystick::GetButtonState
}\label{wxjoystickgetbuttonstate
}
38 \constfunc{int
}{GetButtonState
}{\void}
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.
46 \constfunc{bool
}{GetButtonState
}{\param{unsigned
}{ id
}}
48 Returns the state of the specified joystick button.
50 \wxheading{Parameters
}
52 \docparam{id
}{The button id to
report, from
0 to
\helpref{GetNumberButtons()
}{wxjoystickgetnumberbuttons
} -
1}
54 \membersection{wxJoystick::GetManufacturerId
}\label{wxjoystickgetmanufacturerid
}
56 \constfunc{int
}{GetManufacturerId
}{\void}
58 Returns the manufacturer id.
60 \membersection{wxJoystick::GetMovementThreshold
}\label{wxjoystickgetmovementthreshold
}
62 \constfunc{int
}{GetMovementThreshold
}{\void}
64 Returns the movement threshold, the number of steps outside which the joystick is deemed to have
67 \membersection{wxJoystick::GetNumberAxes
}\label{wxjoystickgetnumberaxes
}
69 \constfunc{int
}{GetNumberAxes
}{\void}
71 Returns the number of axes for this joystick.
73 \membersection{wxJoystick::GetNumberButtons
}\label{wxjoystickgetnumberbuttons
}
75 \constfunc{int
}{GetNumberButtons
}{\void}
77 Returns the number of buttons for this joystick.
79 \membersection{wxJoystick::GetNumberJoysticks
}\label{wxjoystickgetnumberjoysticks
}
81 \func{static int
}{GetNumberJoysticks
}{\void}
83 Returns the number of joysticks currently attached to the computer.
85 \membersection{wxJoystick::GetPollingMax
}\label{wxjoystickgetpollingmax
}
87 \constfunc{int
}{GetPollingMax
}{\void}
89 Returns the maximum polling frequency.
91 \membersection{wxJoystick::GetPollingMin
}\label{wxjoystickgetpollingmin
}
93 \constfunc{int
}{GetPollingMin
}{\void}
95 Returns the minimum polling frequency.
97 \membersection{wxJoystick::GetProductId
}\label{wxjoystickgetproductid
}
99 \constfunc{int
}{GetProductId
}{\void}
101 Returns the product id for the joystick.
103 \membersection{wxJoystick::GetProductName
}\label{wxjoystickgetproductname
}
105 \constfunc{wxString
}{GetProductName
}{\void}
107 Returns the product name for the joystick.
109 \membersection{wxJoystick::GetPosition
}\label{wxjoystickgetposition
}
111 \constfunc{wxPoint
}{GetPosition
}{\void}
113 Returns the x, y position of the joystick.
115 \constfunc{int
}{GetPosition
}{\param{unsigned
}{ axis
}}
117 Returns the position of the specified joystick axis.
119 \wxheading{Parameters
}
121 \docparam{axis
}{The joystick axis to
report, from
0 to
\helpref{GetNumberAxes()
}{wxjoystickgetnumberaxes
} -
1.
}
123 \membersection{wxJoystick::GetPOVPosition
}\label{wxjoystickgetpovposition
}
125 \constfunc{int
}{GetPOVPosition
}{\void}
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.
131 \membersection{wxJoystick::GetPOVCTSPosition
}\label{wxjoystickgetpovctsposition
}
133 \constfunc{int
}{GetPOVCTSPosition
}{\void}
135 Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units.
138 \membersection{wxJoystick::GetRudderMax
}\label{wxjoystickgetruddermax
}
140 \constfunc{int
}{GetRudderMax
}{\void}
142 Returns the maximum rudder position.
144 \membersection{wxJoystick::GetRudderMin
}\label{wxjoystickgetruddermin
}
146 \constfunc{int
}{GetRudderMin
}{\void}
148 Returns the minimum rudder position.
150 \membersection{wxJoystick::GetRudderPosition
}\label{wxjoystickgetrudderposition
}
152 \constfunc{int
}{GetRudderPosition
}{\void}
154 Returns the rudder position.
156 \membersection{wxJoystick::GetUMax
}\label{wxjoystickgetumax
}
158 \constfunc{int
}{GetUMax
}{\void}
160 Returns the maximum U position.
162 \membersection{wxJoystick::GetUMin
}\label{wxjoystickgetumin
}
164 \constfunc{int
}{GetUMin
}{\void}
166 Returns the minimum U position.
168 \membersection{wxJoystick::GetUPosition
}\label{wxjoystickgetuposition
}
170 \constfunc{int
}{GetUPosition
}{\void}
172 Gets the position of the fifth axis of the joystick, if it exists.
174 \membersection{wxJoystick::GetVMax
}\label{wxjoystickgetvmax
}
176 \constfunc{int
}{GetVMax
}{\void}
178 Returns the maximum V position.
180 \membersection{wxJoystick::GetVMin
}\label{wxjoystickgetvmin
}
182 \constfunc{int
}{GetVMin
}{\void}
184 Returns the minimum V position.
186 \membersection{wxJoystick::GetVPosition
}\label{wxjoystickgetvposition
}
188 \constfunc{int
}{GetVPosition
}{\void}
190 Gets the position of the sixth axis of the joystick, if it exists.
192 \membersection{wxJoystick::GetXMax
}\label{wxjoystickgetxmax
}
194 \constfunc{int
}{GetXMax
}{\void}
196 Returns the maximum x position.
198 \membersection{wxJoystick::GetXMin
}\label{wxjoystickgetxmin
}
200 \constfunc{int
}{GetXMin
}{\void}
202 Returns the minimum x position.
204 \membersection{wxJoystick::GetYMax
}\label{wxjoystickgetymax
}
206 \constfunc{int
}{GetYMax
}{\void}
208 Returns the maximum y position.
210 \membersection{wxJoystick::GetYMin
}\label{wxjoystickgetymin
}
212 \constfunc{int
}{GetYMin
}{\void}
214 Returns the minimum y position.
216 \membersection{wxJoystick::GetZMax
}\label{wxjoystickgetzmax
}
218 \constfunc{int
}{GetZMax
}{\void}
220 Returns the maximum z position.
222 \membersection{wxJoystick::GetZMin
}\label{wxjoystickgetzmin
}
224 \constfunc{int
}{GetZMin
}{\void}
226 Returns the minimum z position.
228 \membersection{wxJoystick::GetZPosition
}\label{wxjoystickgetzposition
}
230 \constfunc{int
}{GetZPosition
}{\void}
232 Returns the z position of the joystick.
234 \membersection{wxJoystick::HasPOV
}\label{wxjoystickhaspov
}
236 \constfunc{bool
}{HasPOV
}{\void}
238 Returns true if the joystick has a point of view control.
240 \membersection{wxJoystick::HasPOV4Dir
}\label{wxjoystickhaspovfdir
}
242 \constfunc{bool
}{HasPOV4Dir
}{\void}
244 Returns true if the joystick point-of-view supports discrete values (centered, forward, backward, left, and right).
246 \membersection{wxJoystick::HasPOVCTS
}\label{wxjoystickhaspovcts
}
248 \constfunc{bool
}{HasPOVCTS
}{\void}
250 Returns true if the joystick point-of-view supports continuous degree bearings.
252 \membersection{wxJoystick::HasRudder
}\label{wxjoystickhasrudder
}
254 \constfunc{bool
}{HasRudder
}{\void}
256 Returns true if there is a rudder attached to the computer.
258 \membersection{wxJoystick::HasU
}\label{wxjoystickhasu
}
260 \constfunc{bool
}{HasU
}{\void}
262 Returns true if the joystick has a U axis.
264 \membersection{wxJoystick::HasV
}\label{wxjoystickhasv
}
266 \constfunc{bool
}{HasV
}{\void}
268 Returns true if the joystick has a V axis.
270 \membersection{wxJoystick::HasZ
}\label{wxjoystickhasz
}
272 \constfunc{bool
}{HasZ
}{\void}
274 Returns true if the joystick has a Z axis.
276 \membersection{wxJoystick::IsOk
}\label{wxjoystickisok
}
278 \constfunc{bool
}{IsOk
}{\void}
280 Returns true if the joystick is functioning.
282 \membersection{wxJoystick::ReleaseCapture
}\label{wxjoystickreleasecapture
}
284 \func{bool
}{ReleaseCapture
}{\void}
286 Releases the capture set by
{\bf SetCapture
}.
288 \wxheading{Return value
}
290 true if the capture release succeeded.
294 \helpref{wxJoystick::SetCapture
}{wxjoysticksetcapture
},
\helpref{wxJoystickEvent
}{wxjoystickevent
}
296 \membersection{wxJoystick::SetCapture
}\label{wxjoysticksetcapture
}
298 \func{bool
}{SetCapture
}{\param{wxWindow*
}{ win
},
\param{int
}{ pollingFreq =
0}}
300 Sets the capture to direct joystick events to
{\it win
}.
302 \wxheading{Parameters
}
304 \docparam{win
}{The window that will receive joystick events.
}
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.
}
309 \wxheading{Return value
}
311 true if the capture succeeded.
315 \helpref{wxJoystick::ReleaseCapture
}{wxjoystickreleasecapture
},
\helpref{wxJoystickEvent
}{wxjoystickevent
}
317 \membersection{wxJoystick::SetMovementThreshold
}\label{wxjoysticksetmovementthreshold
}
319 \func{void
}{SetMovementThreshold
}{\param{int
}{ threshold
}}
321 Sets the movement threshold, the number of steps outside which the joystick is deemed to have