joystick.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/joystick.h
  3. // Purpose: wxJoystick class
  4. // Author: Stefan Csomor
  5. // Modified by:
  6. // Created: 1998-01-01
  7. // Copyright: (c) Stefan Csomor
  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 GetPosition(unsigned axis) const;
  25. bool GetButtonState(unsigned button) const;
  26. int GetZPosition() const;
  27. int GetButtonState() const;
  28. int GetPOVPosition() const;
  29. int GetPOVCTSPosition() const;
  30. int GetRudderPosition() const;
  31. int GetUPosition() const;
  32. int GetVPosition() const;
  33. int GetMovementThreshold() const;
  34. void SetMovementThreshold(int threshold) ;
  35. // Capabilities
  36. ////////////////////////////////////////////////////////////////////////////
  37. bool IsOk() const; // Checks that the joystick is functioning
  38. static int GetNumberJoysticks() ;
  39. int GetManufacturerId() const ;
  40. int GetProductId() const ;
  41. wxString GetProductName() const ;
  42. int GetXMin() const;
  43. int GetYMin() const;
  44. int GetZMin() const;
  45. int GetXMax() const;
  46. int GetYMax() const;
  47. int GetZMax() const;
  48. int GetNumberButtons() const;
  49. int GetNumberAxes() const;
  50. int GetMaxButtons() const;
  51. int GetMaxAxes() const;
  52. int GetPollingMin() const;
  53. int GetPollingMax() const;
  54. int GetRudderMin() const;
  55. int GetRudderMax() const;
  56. int GetUMin() const;
  57. int GetUMax() const;
  58. int GetVMin() const;
  59. int GetVMax() const;
  60. bool HasRudder() const;
  61. bool HasZ() const;
  62. bool HasU() const;
  63. bool HasV() const;
  64. bool HasPOV() const;
  65. bool HasPOV4Dir() const;
  66. bool HasPOVCTS() const;
  67. // Operations
  68. ////////////////////////////////////////////////////////////////////////////
  69. // pollingFreq = 0 means that movement events are sent when above the threshold.
  70. // If pollingFreq > 0, events are received every this many milliseconds.
  71. bool SetCapture(wxWindow* win, int pollingFreq = 0);
  72. bool ReleaseCapture();
  73. protected:
  74. int m_joystick;
  75. };
  76. #endif
  77. // _WX_JOYSTICK_H_