/src/ois/includes/linux/LinuxJoyStickEvents.h

https://bitbucket.org/cabalistic/ogredeps/ · C Header · 72 lines · 27 code · 9 blank · 36 comment · 0 complexity · 868df2c40756b2f747ab16437f9ad0c8 MD5 · raw file

  1. /*
  2. The zlib/libpng License
  3. Copyright (c) 2005-2007 Phillip Castaneda (pjcast -- www.wreckedgames.com)
  4. This software is provided 'as-is', without any express or implied warranty. In no event will
  5. the authors be held liable for any damages arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose, including commercial
  7. applications, and to alter it and redistribute it freely, subject to the following
  8. restrictions:
  9. 1. The origin of this software must not be misrepresented; you must not claim that
  10. you wrote the original software. If you use this software in a product,
  11. an acknowledgment in the product documentation would be appreciated but is
  12. not required.
  13. 2. Altered source versions must be plainly marked as such, and must not be
  14. misrepresented as being the original software.
  15. 3. This notice may not be removed or altered from any source distribution.
  16. */
  17. #ifndef _LINUX_JOYSTICK_H_EADER_
  18. #define _LINUX_JOYSTICK_H_EADER_
  19. #include "linux/LinuxPrereqs.h"
  20. #include "OISJoyStick.h"
  21. namespace OIS
  22. {
  23. /**
  24. Linux specialization of JoyStick class.. This version is favored over the other.. and has the
  25. *possibility* of Force Feedback.. notice I say possibility, i make no gaurantees under linux,
  26. as FF support is sketchy at best AFAIK.
  27. */
  28. class LinuxJoyStick : public JoyStick
  29. {
  30. public:
  31. LinuxJoyStick(InputManager* creator, bool buffered, const JoyStickInfo& js);
  32. virtual ~LinuxJoyStick();
  33. /** @copydoc Object::setBuffered */
  34. virtual void setBuffered(bool buffered);
  35. /** @copydoc Object::capture */
  36. virtual void capture();
  37. /** @copydoc Object::queryInterface */
  38. virtual Interface* queryInterface(Interface::IType type);
  39. /** @copydoc Object::_initialize */
  40. virtual void _initialize();
  41. /**
  42. @remarks
  43. For internal use only... Returns a structure to the manager, to make the device
  44. availiable for use again
  45. */
  46. JoyStickInfo _getJoyInfo();
  47. static JoyStickInfoList _scanJoys();
  48. static void _clearJoys(JoyStickInfoList &joys);
  49. protected:
  50. int mJoyStick;
  51. LinuxForceFeedback* ff_effect;
  52. std::map <int, int> mButtonMap;
  53. std::map <int, int> mAxisMap;
  54. std::map <int, Range> mRanges;
  55. };
  56. }
  57. #endif //_LINUX_JOYSTICK_H_EADER_