]> git.saurik.com Git - wxWidgets.git/blame - include/wx/unix/joystick.h
don't attempt to convert 8bit values to Unicode in ANSI build
[wxWidgets.git] / include / wx / unix / joystick.h
CommitLineData
101ceb40 1/////////////////////////////////////////////////////////////////////////////
1b88201f 2// Name: wx/unix/joystick.h
101ceb40
JS
3// Purpose: wxJoystick class
4// Author: Guilhem Lavaux
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
99d80019 8// Copyright: (c) Guilhem Lavaux
1b88201f 9// Licence: wxWindows licence
101ceb40
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __JOYSTICKH__
13#define __JOYSTICKH__
14
101ceb40
JS
15#include "wx/event.h"
16#include "wx/thread.h"
17
b5dbe15d 18class WXDLLIMPEXP_FWD_CORE wxJoystickThread;
a800dc50 19
1a2fe0cb 20class WXDLLIMPEXP_ADV wxJoystick: public wxObject
101ceb40 21{
a800dc50
RD
22 DECLARE_DYNAMIC_CLASS(wxJoystick)
23 public:
24 /*
25 * Public interface
26 */
27
28 wxJoystick(int joystick = wxJOYSTICK1);
d3c7fc99 29 virtual ~wxJoystick();
a800dc50
RD
30
31 // Attributes
32 ////////////////////////////////////////////////////////////////////////////
33
34 wxPoint GetPosition() const;
e6733873
VZ
35 int GetPosition(unsigned axis) const;
36 bool GetButtonState(unsigned button) const;
a800dc50
RD
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) ;
46
47 // Capabilities
48 ////////////////////////////////////////////////////////////////////////////
49
50 bool IsOk() const; // Checks that the joystick is functioning
da9e9563 51 static int GetNumberJoysticks() ;
a800dc50
RD
52 int GetManufacturerId() const ;
53 int GetProductId() const ;
54 wxString GetProductName() const ;
55 int GetXMin() const;
56 int GetYMin() const;
57 int GetZMin() const;
58 int GetXMax() const;
59 int GetYMax() const;
60 int GetZMax() 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;
69 int GetUMin() const;
70 int GetUMax() const;
71 int GetVMin() const;
72 int GetVMax() const;
73
74 bool HasRudder() const;
75 bool HasZ() const;
76 bool HasU() const;
77 bool HasV() const;
78 bool HasPOV() const;
79 bool HasPOV4Dir() const;
80 bool HasPOVCTS() const;
81
82 // Operations
83 ////////////////////////////////////////////////////////////////////////////
84
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();
101ceb40
JS
89
90protected:
a800dc50
RD
91 int m_device;
92 int m_joystick;
93 wxJoystickThread* m_thread;
101ceb40
JS
94};
95
96#endif
1b88201f 97 // __JOYSTICKH__