]> git.saurik.com Git - wxWidgets.git/blame - include/wx/unix/joystick.h
Don't send selection events for an already selected item in wxMSW wxListBox.
[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
204abcd4
PC
12#ifndef _WX_UNIX_JOYSTICK_H_
13#define _WX_UNIX_JOYSTICK_H_
101ceb40 14
101ceb40 15#include "wx/event.h"
101ceb40 16
b5dbe15d 17class WXDLLIMPEXP_FWD_CORE wxJoystickThread;
a800dc50 18
1a2fe0cb 19class WXDLLIMPEXP_ADV wxJoystick: public wxObject
101ceb40 20{
a800dc50
RD
21 DECLARE_DYNAMIC_CLASS(wxJoystick)
22 public:
23 /*
24 * Public interface
25 */
26
27 wxJoystick(int joystick = wxJOYSTICK1);
d3c7fc99 28 virtual ~wxJoystick();
a800dc50
RD
29
30 // Attributes
31 ////////////////////////////////////////////////////////////////////////////
32
33 wxPoint GetPosition() const;
e6733873
VZ
34 int GetPosition(unsigned axis) const;
35 bool GetButtonState(unsigned button) const;
a800dc50
RD
36 int GetZPosition() const;
37 int GetButtonState() const;
38 int GetPOVPosition() const;
39 int GetPOVCTSPosition() const;
40 int GetRudderPosition() const;
41 int GetUPosition() const;
42 int GetVPosition() const;
43 int GetMovementThreshold() const;
44 void SetMovementThreshold(int threshold) ;
45
46 // Capabilities
47 ////////////////////////////////////////////////////////////////////////////
48
49 bool IsOk() const; // Checks that the joystick is functioning
da9e9563 50 static int GetNumberJoysticks() ;
a800dc50
RD
51 int GetManufacturerId() const ;
52 int GetProductId() const ;
53 wxString GetProductName() const ;
54 int GetXMin() const;
55 int GetYMin() const;
56 int GetZMin() const;
57 int GetXMax() const;
58 int GetYMax() const;
59 int GetZMax() const;
60 int GetNumberButtons() const;
61 int GetNumberAxes() const;
62 int GetMaxButtons() const;
63 int GetMaxAxes() const;
64 int GetPollingMin() const;
65 int GetPollingMax() const;
66 int GetRudderMin() const;
67 int GetRudderMax() const;
68 int GetUMin() const;
69 int GetUMax() const;
70 int GetVMin() const;
71 int GetVMax() const;
72
73 bool HasRudder() const;
74 bool HasZ() const;
75 bool HasU() const;
76 bool HasV() const;
77 bool HasPOV() const;
78 bool HasPOV4Dir() const;
79 bool HasPOVCTS() const;
80
81 // Operations
82 ////////////////////////////////////////////////////////////////////////////
83
84 // pollingFreq = 0 means that movement events are sent when above the threshold.
85 // If pollingFreq > 0, events are received every this many milliseconds.
86 bool SetCapture(wxWindow* win, int pollingFreq = 0);
87 bool ReleaseCapture();
101ceb40
JS
88
89protected:
a800dc50
RD
90 int m_device;
91 int m_joystick;
92 wxJoystickThread* m_thread;
101ceb40
JS
93};
94
204abcd4 95#endif // _WX_UNIX_JOYSTICK_H_