joystick.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/x11/joystick.h
  3. // Purpose: wxJoystick class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 17/09/98
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_JOYSTICK_H_
  11. #define _WX_JOYSTICK_H_
  12. #include "wx/event.h"
  13. class WXDLLIMPEXP_ADV wxJoystick: public wxObject
  14. {
  15. DECLARE_DYNAMIC_CLASS(wxJoystick)
  16. public:
  17. /*
  18. * Public interface
  19. */
  20. wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; }
  21. // Attributes
  22. ////////////////////////////////////////////////////////////////////////////
  23. wxPoint GetPosition() const;
  24. int GetZPosition() const;
  25. int GetButtonState() const;
  26. int GetPOVPosition() const;
  27. int GetPOVCTSPosition() const;
  28. int GetRudderPosition() const;
  29. int GetUPosition() const;
  30. int GetVPosition() const;
  31. int GetMovementThreshold() const;
  32. void SetMovementThreshold(int threshold) ;
  33. // Capabilities
  34. ////////////////////////////////////////////////////////////////////////////
  35. bool IsOk() const; // Checks that the joystick is functioning
  36. static int GetNumberJoysticks() ;
  37. int GetManufacturerId() const ;
  38. int GetProductId() const ;
  39. wxString GetProductName() const ;
  40. int GetXMin() const;
  41. int GetYMin() const;
  42. int GetZMin() const;
  43. int GetXMax() const;
  44. int GetYMax() const;
  45. int GetZMax() const;
  46. int GetNumberButtons() const;
  47. int GetNumberAxes() const;
  48. int GetMaxButtons() const;
  49. int GetMaxAxes() const;
  50. int GetPollingMin() const;
  51. int GetPollingMax() const;
  52. int GetRudderMin() const;
  53. int GetRudderMax() const;
  54. int GetUMin() const;
  55. int GetUMax() const;
  56. int GetVMin() const;
  57. int GetVMax() const;
  58. bool HasRudder() const;
  59. bool HasZ() const;
  60. bool HasU() const;
  61. bool HasV() const;
  62. bool HasPOV() const;
  63. bool HasPOV4Dir() const;
  64. bool HasPOVCTS() const;
  65. // Operations
  66. ////////////////////////////////////////////////////////////////////////////
  67. // pollingFreq = 0 means that movement events are sent when above the threshold.
  68. // If pollingFreq > 0, events are received every this many milliseconds.
  69. bool SetCapture(wxWindow* win, int pollingFreq = 0);
  70. bool ReleaseCapture();
  71. protected:
  72. int m_joystick;
  73. };
  74. #endif
  75. // _WX_JOYSTICK_H_