]>
Commit | Line | Data |
---|---|---|
101ceb40 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: joystick.h | |
3 | // Purpose: wxJoystick class | |
4 | // Author: Guilhem Lavaux | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: | |
65571936 | 9 | // Licence: wxWindows licence |
101ceb40 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef __JOYSTICKH__ | |
13 | #define __JOYSTICKH__ | |
14 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
101ceb40 JS |
16 | #pragma interface "joystick.h" |
17 | #endif | |
18 | ||
19 | #include "wx/event.h" | |
20 | #include "wx/thread.h" | |
21 | ||
a800dc50 RD |
22 | class WXDLLEXPORT wxJoystickThread; |
23 | ||
24 | class WXDLLEXPORT wxJoystick: public wxObject | |
101ceb40 | 25 | { |
a800dc50 RD |
26 | DECLARE_DYNAMIC_CLASS(wxJoystick) |
27 | public: | |
28 | /* | |
29 | * Public interface | |
30 | */ | |
31 | ||
32 | wxJoystick(int joystick = wxJOYSTICK1); | |
33 | ~wxJoystick(); | |
34 | ||
35 | // Attributes | |
36 | //////////////////////////////////////////////////////////////////////////// | |
37 | ||
38 | wxPoint GetPosition() const; | |
39 | int GetZPosition() const; | |
40 | int GetButtonState() const; | |
41 | int GetPOVPosition() const; | |
42 | int GetPOVCTSPosition() const; | |
43 | int GetRudderPosition() const; | |
44 | int GetUPosition() const; | |
45 | int GetVPosition() const; | |
46 | int GetMovementThreshold() const; | |
47 | void SetMovementThreshold(int threshold) ; | |
48 | ||
49 | // Capabilities | |
50 | //////////////////////////////////////////////////////////////////////////// | |
51 | ||
52 | bool IsOk() const; // Checks that the joystick is functioning | |
53 | int GetNumberJoysticks() const ; | |
54 | int GetManufacturerId() const ; | |
55 | int GetProductId() const ; | |
56 | wxString GetProductName() const ; | |
57 | int GetXMin() const; | |
58 | int GetYMin() const; | |
59 | int GetZMin() const; | |
60 | int GetXMax() const; | |
61 | int GetYMax() const; | |
62 | int GetZMax() const; | |
63 | int GetNumberButtons() const; | |
64 | int GetNumberAxes() const; | |
65 | int GetMaxButtons() const; | |
66 | int GetMaxAxes() const; | |
67 | int GetPollingMin() const; | |
68 | int GetPollingMax() const; | |
69 | int GetRudderMin() const; | |
70 | int GetRudderMax() const; | |
71 | int GetUMin() const; | |
72 | int GetUMax() const; | |
73 | int GetVMin() const; | |
74 | int GetVMax() const; | |
75 | ||
76 | bool HasRudder() const; | |
77 | bool HasZ() const; | |
78 | bool HasU() const; | |
79 | bool HasV() const; | |
80 | bool HasPOV() const; | |
81 | bool HasPOV4Dir() const; | |
82 | bool HasPOVCTS() const; | |
83 | ||
84 | // Operations | |
85 | //////////////////////////////////////////////////////////////////////////// | |
86 | ||
87 | // pollingFreq = 0 means that movement events are sent when above the threshold. | |
88 | // If pollingFreq > 0, events are received every this many milliseconds. | |
89 | bool SetCapture(wxWindow* win, int pollingFreq = 0); | |
90 | bool ReleaseCapture(); | |
101ceb40 JS |
91 | |
92 | protected: | |
a800dc50 RD |
93 | int m_device; |
94 | int m_joystick; | |
95 | wxJoystickThread* m_thread; | |
101ceb40 JS |
96 | }; |
97 | ||
98 | #endif | |
a800dc50 | 99 | // __JOYSTICKH__ |
101ceb40 | 100 |