]>
git.saurik.com Git - wxWidgets.git/blob - interface/joystick.h
52bad0c9fa7a1461bc981a8e9c6635235bb33e6f
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. @a 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
43 int GetButtonState() const;
44 const bool GetButtonState(unsigned id
) const;
48 Returns the manufacturer id.
50 int GetManufacturerId() const;
53 Returns the movement threshold, the number of steps outside which the joystick
57 int GetMovementThreshold() const;
60 Returns the number of axes for this joystick.
62 int GetNumberAxes() const;
65 Returns the number of buttons for this joystick.
67 int GetNumberButtons() const;
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() const;
82 Returns the point-of-view position, expressed in continuous, one-hundredth of a
84 but limited to return 0, 9000, 18000 or 27000.
87 int GetPOVPosition() const;
90 Returns the maximum polling frequency.
92 int GetPollingMax() const;
95 Returns the minimum polling frequency.
97 int GetPollingMin() const;
101 Returns the position of the specified joystick axis.
104 The joystick axis to report, from 0 to GetNumberAxes() - 1.
106 wxPoint
GetPosition() const;
107 const int GetPosition(unsigned axis
) const;
111 Returns the product id for the joystick.
113 int GetProductId() const;
116 Returns the product name for the joystick.
118 wxString
GetProductName() const;
121 Returns the maximum rudder position.
123 int GetRudderMax() const;
126 Returns the minimum rudder position.
128 int GetRudderMin() const;
131 Returns the rudder position.
133 int GetRudderPosition() const;
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.
148 int GetUPosition() const;
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.
163 int GetVPosition() const;
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.
198 int GetZPosition() const;
201 Returns @true if the joystick has a point of view control.
206 Returns @true if the joystick point-of-view supports discrete values (centered,
207 forward, backward, left, and right).
209 bool HasPOV4Dir() const;
212 Returns @true if the joystick point-of-view supports continuous degree bearings.
214 #define bool HasPOVCTS() const /* implementation is private */
217 Returns @true if there is a rudder attached to the computer.
219 bool HasRudder() const;
222 Returns @true if the joystick has a U axis.
227 Returns @true if the joystick has a V axis.
232 Returns @true if the joystick has a Z axis.
237 Returns @true if the joystick is functioning.
242 Releases the capture set by @b SetCapture.
244 @returns @true if the capture release succeeded.
246 @see SetCapture(), wxJoystickEvent
248 bool ReleaseCapture();
251 Sets the capture to direct joystick events to @e win.
254 The window that will receive joystick events.
256 If zero, movement events are sent when above the
257 threshold. If greater than zero, events are received every pollingFreq
260 @returns @true if the capture succeeded.
262 @see ReleaseCapture(), wxJoystickEvent
264 bool SetCapture(wxWindow
* win
, int pollingFreq
= 0);
267 Sets the movement threshold, the number of steps outside which the joystick is
271 void SetMovementThreshold(int threshold
);