joystick.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/joystick.h
  3. // Purpose: wxJoystick class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 01/02/97
  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);
  21. // Attributes
  22. ////////////////////////////////////////////////////////////////////////////
  23. wxPoint GetPosition(void) const;
  24. int GetPosition(unsigned axis) const;
  25. bool GetButtonState(unsigned button) const;
  26. int GetZPosition(void) const;
  27. int GetButtonState(void) const;
  28. int GetPOVPosition(void) const;
  29. int GetPOVCTSPosition(void) const;
  30. int GetRudderPosition(void) const;
  31. int GetUPosition(void) const;
  32. int GetVPosition(void) const;
  33. int GetMovementThreshold(void) const;
  34. void SetMovementThreshold(int threshold) ;
  35. // Capabilities
  36. ////////////////////////////////////////////////////////////////////////////
  37. static int GetNumberJoysticks(void);
  38. bool IsOk(void) const; // Checks that the joystick is functioning
  39. int GetManufacturerId(void) const ;
  40. int GetProductId(void) const ;
  41. wxString GetProductName(void) const ;
  42. int GetXMin(void) const;
  43. int GetYMin(void) const;
  44. int GetZMin(void) const;
  45. int GetXMax(void) const;
  46. int GetYMax(void) const;
  47. int GetZMax(void) const;
  48. int GetNumberButtons(void) const;
  49. int GetNumberAxes(void) const;
  50. int GetMaxButtons(void) const;
  51. int GetMaxAxes(void) const;
  52. int GetPollingMin(void) const;
  53. int GetPollingMax(void) const;
  54. int GetRudderMin(void) const;
  55. int GetRudderMax(void) const;
  56. int GetUMin(void) const;
  57. int GetUMax(void) const;
  58. int GetVMin(void) const;
  59. int GetVMax(void) const;
  60. bool HasRudder(void) const;
  61. bool HasZ(void) const;
  62. bool HasU(void) const;
  63. bool HasV(void) const;
  64. bool HasPOV(void) const;
  65. bool HasPOV4Dir(void) const;
  66. bool HasPOVCTS(void) 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(void);
  73. protected:
  74. int m_joystick;
  75. };
  76. #endif
  77. // _WX_JOYSTICK_H_