]>
git.saurik.com Git - wxWidgets.git/blob - interface/joystick.h
9ed0ccff358cc1dc789bd3f66f955d532a6e6fb7
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxJoystick class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 wxJoystick allows an application to control one or more joysticks.
21 class wxJoystick
: public wxObject
25 Constructor. @e joystick may be one of wxJOYSTICK1, wxJOYSTICK2, indicating the
27 controller of interest.
29 wxJoystick(int joystick
= wxJOYSTICK1
);
32 Destroys the wxJoystick object.
38 Returns the state of the specified joystick button.
41 The button id to report, from 0 to GetNumberButtons() - 1
44 bool GetButtonState(unsigned id
);
48 Returns the manufacturer id.
50 int GetManufacturerId();
53 Returns the movement threshold, the number of steps outside which the joystick
57 int GetMovementThreshold();
60 Returns the number of axes for this joystick.
65 Returns the number of buttons for this joystick.
67 int GetNumberButtons();
70 Returns the number of joysticks currently attached to the computer.
72 static int GetNumberJoysticks();
75 Returns the point-of-view position, expressed in continuous, one-hundredth of a
79 int GetPOVCTSPosition();
82 Returns the point-of-view position, expressed in continuous, one-hundredth of a
84 but limited to return 0, 9000, 18000 or 27000.
90 Returns the maximum polling frequency.
95 Returns the minimum polling frequency.
101 Returns the position of the specified joystick axis.
104 The joystick axis to report, from 0 to GetNumberAxes() - 1.
106 wxPoint
GetPosition();
107 int GetPosition(unsigned axis
);
111 Returns the product id for the joystick.
116 Returns the product name for the joystick.
118 wxString
GetProductName();
121 Returns the maximum rudder position.
126 Returns the minimum rudder position.
131 Returns the rudder position.
133 int GetRudderPosition();
136 Returns the maximum U position.
141 Returns the minimum U position.
146 Gets the position of the fifth axis of the joystick, if it exists.
151 Returns the maximum V position.
156 Returns the minimum V position.
161 Gets the position of the sixth axis of the joystick, if it exists.
166 Returns the maximum x position.
171 Returns the minimum x position.
176 Returns the maximum y position.
181 Returns the minimum y position.
186 Returns the maximum z position.
191 Returns the minimum z position.
196 Returns the z position of the joystick.
201 Returns @true if the joystick has a point of view control.
203 #define bool HasPOV() /* implementation is private */
206 Returns @true if the joystick point-of-view supports discrete values (centered,
207 forward, backward, left, and right).
212 Returns @true if the joystick point-of-view supports continuous degree bearings.
214 #define bool HasPOVCTS() /* implementation is private */
217 Returns @true if there is a rudder attached to the computer.
222 Returns @true if the joystick has a U axis.
224 #define bool HasU() /* implementation is private */
227 Returns @true if the joystick has a V axis.
229 #define bool HasV() /* implementation is private */
232 Returns @true if the joystick has a Z axis.
234 #define bool HasZ() /* implementation is private */
237 Returns @true if the joystick is functioning.
239 #define bool IsOk() /* implementation is private */
242 Releases the capture set by @b SetCapture.
244 @returns @true if the capture release succeeded.
246 @sa SetCapture(), wxJoystickEvent
248 bool ReleaseCapture();
251 Sets the capture to direct joystick events to @e win.
254 The window that will receive joystick events.
257 If zero, movement events are sent when above the
258 threshold. If greater than zero, events are received every pollingFreq
261 @returns @true if the capture succeeded.
263 @sa ReleaseCapture(), wxJoystickEvent
265 bool SetCapture(wxWindow
* win
, int pollingFreq
= 0);
268 Sets the movement threshold, the number of steps outside which the joystick is
272 void SetMovementThreshold(int threshold
);