X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ae3c17b4013e80b99976c750c19fca47729517f6..7344108e8a129a3f9b4df5ab0f98a1713db03b89:/interface/wx/joystick.h diff --git a/interface/wx/joystick.h b/interface/wx/joystick.h index d9b739c6ff..eb519f3037 100644 --- a/interface/wx/joystick.h +++ b/interface/wx/joystick.h @@ -3,17 +3,16 @@ // Purpose: interface of wxJoystick // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @class wxJoystick - @wxheader{joystick.h} wxJoystick allows an application to control one or more joysticks. @library{wxadv} - @category{FIXME} + @category{misc} @see wxJoystickEvent */ @@ -21,8 +20,9 @@ class wxJoystick : public wxObject { public: /** - Constructor. @a joystick may be one of wxJOYSTICK1, wxJOYSTICK2, indicating the - joystick + Constructor. + + @a joystick may be one of wxJOYSTICK1, wxJOYSTICK2, indicating the joystick controller of interest. */ wxJoystick(int joystick = wxJOYSTICK1); @@ -30,18 +30,25 @@ public: /** Destroys the wxJoystick object. */ - ~wxJoystick(); + virtual ~wxJoystick(); + + /** + Returns the state of the joystick buttons. + Every button is mapped to a single bit in the returned integer, with the + first button being mapped to the least significant bit, and so on. + + A bitlist of wxJOY_BUTTONn identifiers, where n is 1, 2, 3 or 4 is available + for historical reasons. + */ + int GetButtonState() const; - //@{ /** Returns the state of the specified joystick button. @param id The button id to report, from 0 to GetNumberButtons() - 1 */ - int GetButtonState() const; - const bool GetButtonState(unsigned id) const; - //@} + bool GetButtonState(unsigned int id) const; /** Returns the manufacturer id. @@ -73,14 +80,15 @@ public: /** Returns the point-of-view position, expressed in continuous, one-hundredth of a degree units. + Returns -1 on error. */ int GetPOVCTSPosition() const; /** Returns the point-of-view position, expressed in continuous, one-hundredth of a - degree units, - but limited to return 0, 9000, 18000 or 27000. + degree units, but limited to return 0, 9000, 18000 or 27000. + Returns -1 on error. */ int GetPOVPosition() const; @@ -95,16 +103,18 @@ public: */ int GetPollingMin() const; - //@{ + /** + Returns the x, y position of the joystick. + */ + wxPoint GetPosition() const; + /** Returns the position of the specified joystick axis. @param axis The joystick axis to report, from 0 to GetNumberAxes() - 1. */ - wxPoint GetPosition() const; - const int GetPosition(unsigned axis) const; - //@} + int GetPosition(unsigned int axis) const; /** Returns the product id for the joystick. @@ -202,15 +212,15 @@ public: bool HasPOV() const; /** - Returns @true if the joystick point-of-view supports discrete values (centered, - forward, backward, left, and right). + Returns @true if the joystick point-of-view supports discrete values + (centered, forward, backward, left, and right). */ bool HasPOV4Dir() const; /** Returns @true if the joystick point-of-view supports continuous degree bearings. */ -#define bool HasPOVCTS() const /* implementation is private */ + bool HasPOVCTS() const; /** Returns @true if there is a rudder attached to the computer. @@ -247,14 +257,13 @@ public: bool ReleaseCapture(); /** - Sets the capture to direct joystick events to @e win. + Sets the capture to direct joystick events to @a win. @param win The window that will receive joystick events. @param pollingFreq - If zero, movement events are sent when above the - threshold. If greater than zero, events are received every pollingFreq - milliseconds. + If zero, movement events are sent when above the threshold. + If greater than zero, events are received every @a pollingFreq milliseconds. @return @true if the capture succeeded. @@ -264,8 +273,7 @@ public: /** Sets the movement threshold, the number of steps outside which the joystick is - deemed to have - moved. + deemed to have moved. */ void SetMovementThreshold(int threshold); };