BsLinuxInput.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsCorePrerequisites.h"
  5. #include "Input/BsInputFwd.h"
  6. namespace bs
  7. {
  8. /** Infomation about an analog axis that's part of a gamepad. */
  9. struct AxisInfo
  10. {
  11. INT32 axisIdx;
  12. INT32 min;
  13. INT32 max;
  14. };
  15. /** Information about a gamepad. */
  16. struct GamepadInfo
  17. {
  18. UINT32 id;
  19. UINT32 eventHandlerIdx;
  20. String name;
  21. UnorderedMap<INT32, ButtonCode> buttonMap;
  22. UnorderedMap<INT32, AxisInfo> axisMap;
  23. };
  24. /**
  25. * Data specific to Linux implementation of the input system. Can be passed to platform specific implementations of
  26. * the individual device types.
  27. */
  28. struct InputPrivateData
  29. {
  30. Vector<GamepadInfo> gamepadInfos;
  31. };
  32. /** Data about relative pointer / scroll wheel movement. */
  33. struct LinuxMouseMotionEvent
  34. {
  35. double deltaX; /**< Relative pointer movement in X direction. */
  36. double deltaY; /**< Relative pointer movement in Y direction. */
  37. double deltaZ; /**< Relative vertical scroll amount. */
  38. };
  39. /** Data about a single button press or release. */
  40. struct LinuxButtonEvent
  41. {
  42. UINT64 timestamp;
  43. ButtonCode button;
  44. bool pressed;
  45. };
  46. #define BUFFER_SIZE_GAMEPAD 64
  47. }