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 /////////////////////////////////////////////////////////////////////////////
16 #include "wx/thread.h"
18 class WXDLLIMPEXP_FWD_CORE wxJoystickThread
;
20 class WXDLLEXPORT wxJoystick
: public wxObject
22 DECLARE_DYNAMIC_CLASS(wxJoystick
)
28 wxJoystick(int joystick
= wxJOYSTICK1
);
29 virtual ~wxJoystick();
32 ////////////////////////////////////////////////////////////////////////////
34 wxPoint
GetPosition() const;
35 int GetPosition(unsigned axis
) const;
36 bool GetButtonState(unsigned button
) const;
37 int GetZPosition() const;
38 int GetButtonState() const;
39 int GetPOVPosition() const;
40 int GetPOVCTSPosition() const;
41 int GetRudderPosition() const;
42 int GetUPosition() const;
43 int GetVPosition() const;
44 int GetMovementThreshold() const;
45 void SetMovementThreshold(int threshold
) ;
48 ////////////////////////////////////////////////////////////////////////////
50 bool IsOk() const; // Checks that the joystick is functioning
51 static int GetNumberJoysticks() ;
52 int GetManufacturerId() const ;
53 int GetProductId() const ;
54 wxString
GetProductName() const ;
61 int GetNumberButtons() const;
62 int GetNumberAxes() const;
63 int GetMaxButtons() const;
64 int GetMaxAxes() const;
65 int GetPollingMin() const;
66 int GetPollingMax() const;
67 int GetRudderMin() const;
68 int GetRudderMax() const;
74 bool HasRudder() const;
79 bool HasPOV4Dir() const;
80 bool HasPOVCTS() const;
83 ////////////////////////////////////////////////////////////////////////////
85 // pollingFreq = 0 means that movement events are sent when above the threshold.
86 // If pollingFreq > 0, events are received every this many milliseconds.
87 bool SetCapture(wxWindow
* win
, int pollingFreq
= 0);
88 bool ReleaseCapture();
93 wxJoystickThread
* m_thread
;