1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/x11/joystick.h
3 // Purpose:     wxJoystick class
4 // Author:      Julian Smart
5 // Modified by:
6 // Created:     17/09/98
7 // Copyright:   (c) Julian Smart
8 // Licence:     wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10 
11 #ifndef _WX_JOYSTICK_H_
12 #define _WX_JOYSTICK_H_
13 
14 #include "wx/event.h"
15 
16 class WXDLLIMPEXP_ADV wxJoystick: public wxObject
17 {
DECLARE_DYNAMIC_CLASS(wxJoystick)18     DECLARE_DYNAMIC_CLASS(wxJoystick)
19 public:
20 /*
21 * Public interface
22     */
23 
24     wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; }
25 
26     // Attributes
27     ////////////////////////////////////////////////////////////////////////////
28 
29     wxPoint GetPosition() const;
30     int GetZPosition() const;
31     int GetButtonState() const;
32     int GetPOVPosition() const;
33     int GetPOVCTSPosition() const;
34     int GetRudderPosition() const;
35     int GetUPosition() const;
36     int GetVPosition() const;
37     int GetMovementThreshold() const;
38     void SetMovementThreshold(int threshold) ;
39 
40     // Capabilities
41     ////////////////////////////////////////////////////////////////////////////
42 
43     bool IsOk() const; // Checks that the joystick is functioning
44     static int GetNumberJoysticks() ;
45     int GetManufacturerId() const ;
46     int GetProductId() const ;
47     wxString GetProductName() const ;
48     int GetXMin() const;
49     int GetYMin() const;
50     int GetZMin() const;
51     int GetXMax() const;
52     int GetYMax() const;
53     int GetZMax() const;
54     int GetNumberButtons() const;
55     int GetNumberAxes() const;
56     int GetMaxButtons() const;
57     int GetMaxAxes() const;
58     int GetPollingMin() const;
59     int GetPollingMax() const;
60     int GetRudderMin() const;
61     int GetRudderMax() const;
62     int GetUMin() const;
63     int GetUMax() const;
64     int GetVMin() const;
65     int GetVMax() const;
66 
67     bool HasRudder() const;
68     bool HasZ() const;
69     bool HasU() const;
70     bool HasV() const;
71     bool HasPOV() const;
72     bool HasPOV4Dir() const;
73     bool HasPOVCTS() const;
74 
75     // Operations
76     ////////////////////////////////////////////////////////////////////////////
77 
78     // pollingFreq = 0 means that movement events are sent when above the threshold.
79     // If pollingFreq > 0, events are received every this many milliseconds.
80     bool SetCapture(wxWindow* win, int pollingFreq = 0);
81     bool ReleaseCapture();
82 
83 protected:
84     int       m_joystick;
85 };
86 
87 #endif
88     // _WX_JOYSTICK_H_
89