1 ///////////////////////////////////////////////////////////////////////////// 
   2 // Name:        wx/osx/core/joystick.h 
   3 // Purpose:     wxJoystick class 
   7 // Copyright:   (c) Ryan Norton 
   8 // Licence:     wxWindows licence 
   9 ///////////////////////////////////////////////////////////////////////////// 
  11 #ifndef _WX_JOYSTICK_H_ 
  12 #define _WX_JOYSTICK_H_ 
  16 class WXDLLIMPEXP_FWD_CORE wxJoystickThread
; 
  18 class WXDLLIMPEXP_ADV wxJoystick
: public wxObject
 
  20     DECLARE_DYNAMIC_CLASS(wxJoystick
) 
  23     wxJoystick(int joystick 
= wxJOYSTICK1
); 
  24     virtual ~wxJoystick(); 
  27     //////////////////////////////////////////////////////////////////////////// 
  29     wxPoint 
GetPosition() const; 
  30     int GetPosition(unsigned axis
) const; 
  31     bool GetButtonState(unsigned button
) const; 
  32     int GetZPosition() const; 
  33     int GetButtonState() const; 
  34     int GetPOVPosition() const; 
  35     int GetPOVCTSPosition() const; 
  36     int GetRudderPosition() const; 
  37     int GetUPosition() const; 
  38     int GetVPosition() const; 
  39     int GetMovementThreshold() const; 
  40     void SetMovementThreshold(int threshold
) ; 
  43     //////////////////////////////////////////////////////////////////////////// 
  45     bool IsOk() const; // Checks that the joystick is functioning 
  46     static int GetNumberJoysticks() ; 
  47     int GetManufacturerId() const ; 
  48     int GetProductId() const ; 
  49     wxString 
GetProductName() const ; 
  56     int GetNumberButtons() const; 
  57     int GetNumberAxes() const; 
  58     int GetMaxButtons() const; 
  59     int GetMaxAxes() const; 
  60     int GetPollingMin() const; 
  61     int GetPollingMax() const; 
  62     int GetRudderMin() const; 
  63     int GetRudderMax() const; 
  69     bool HasRudder() const; 
  74     bool HasPOV4Dir() const; 
  75     bool HasPOVCTS() const; 
  78     //////////////////////////////////////////////////////////////////////////// 
  80     // pollingFreq = 0 means that movement events are sent when above the threshold. 
  81     // If pollingFreq > 0, events are received every this many milliseconds. 
  82     bool SetCapture(wxWindow
* win
, int pollingFreq 
= 0); 
  83     bool ReleaseCapture(); 
  87     wxJoystickThread
*   m_thread
; 
  88     class wxHIDJoystick
* m_hid
;