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