1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/unix/joystick.h
3 // Purpose: wxJoystick class
4 // Author: Guilhem Lavaux
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_UNIX_JOYSTICK_H_
13 #define _WX_UNIX_JOYSTICK_H_
17 class WXDLLIMPEXP_FWD_CORE wxJoystickThread
;
19 class WXDLLIMPEXP_ADV wxJoystick
: public wxObject
21 DECLARE_DYNAMIC_CLASS(wxJoystick
)
27 wxJoystick(int joystick
= wxJOYSTICK1
);
28 virtual ~wxJoystick();
31 ////////////////////////////////////////////////////////////////////////////
33 wxPoint
GetPosition() const;
34 int GetPosition(unsigned axis
) const;
35 bool GetButtonState(unsigned button
) const;
36 int GetZPosition() const;
37 int GetButtonState() const;
38 int GetPOVPosition() const;
39 int GetPOVCTSPosition() const;
40 int GetRudderPosition() const;
41 int GetUPosition() const;
42 int GetVPosition() const;
43 int GetMovementThreshold() const;
44 void SetMovementThreshold(int threshold
) ;
47 ////////////////////////////////////////////////////////////////////////////
49 bool IsOk() const; // Checks that the joystick is functioning
50 static int GetNumberJoysticks() ;
51 int GetManufacturerId() const ;
52 int GetProductId() const ;
53 wxString
GetProductName() const ;
60 int GetNumberButtons() const;
61 int GetNumberAxes() const;
62 int GetMaxButtons() const;
63 int GetMaxAxes() const;
64 int GetPollingMin() const;
65 int GetPollingMax() const;
66 int GetRudderMin() const;
67 int GetRudderMax() const;
73 bool HasRudder() const;
78 bool HasPOV4Dir() const;
79 bool HasPOVCTS() const;
82 ////////////////////////////////////////////////////////////////////////////
84 // pollingFreq = 0 means that movement events are sent when above the threshold.
85 // If pollingFreq > 0, events are received every this many milliseconds.
86 bool SetCapture(wxWindow
* win
, int pollingFreq
= 0);
87 bool ReleaseCapture();
92 wxJoystickThread
* m_thread
;
95 #endif // _WX_UNIX_JOYSTICK_H_