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