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