]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/unix/joystick.h
added wxWindow::HasFocus() for more convenient way of determining if a (possibly...
[wxWidgets.git] / include / wx / unix / joystick.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/unix/joystick.h
3// Purpose: wxJoystick class
4// Author: Guilhem Lavaux
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) Guilhem Lavaux
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_UNIX_JOYSTICK_H_
13#define _WX_UNIX_JOYSTICK_H_
14
15#include "wx/event.h"
16
17class WXDLLIMPEXP_FWD_CORE wxJoystickThread;
18
19class WXDLLIMPEXP_ADV wxJoystick: public wxObject
20{
21 DECLARE_DYNAMIC_CLASS(wxJoystick)
22 public:
23 /*
24 * Public interface
25 */
26
27 wxJoystick(int joystick = wxJOYSTICK1);
28 virtual ~wxJoystick();
29
30 // Attributes
31 ////////////////////////////////////////////////////////////////////////////
32
33 wxPoint GetPosition() const;
34 int GetPosition(unsigned axis) const;
35 bool GetButtonState(unsigned button) const;
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
50 static int GetNumberJoysticks() ;
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();
88
89protected:
90 int m_device;
91 int m_joystick;
92 wxJoystickThread* m_thread;
93};
94
95#endif // _WX_UNIX_JOYSTICK_H_