InputSourceTouch.h 890 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * InputSourceTouch.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. VCMI_LIB_NAMESPACE_BEGIN
  12. class Point;
  13. VCMI_LIB_NAMESPACE_END
  14. struct SDL_TouchFingerEvent;
  15. class InputSourceTouch
  16. {
  17. bool multifinger;
  18. bool isPointerRelativeMode;
  19. /// moves mouse pointer into specified position inside vcmi window
  20. void moveCursorToPosition(const Point & position);
  21. Point convertTouchToMouse(const SDL_TouchFingerEvent & current);
  22. void fakeMouseButtonEventRelativeMode(bool down, bool right);
  23. public:
  24. InputSourceTouch();
  25. void handleEventFingerMotion(const SDL_TouchFingerEvent & current);
  26. void handleEventFingerDown(const SDL_TouchFingerEvent & current);
  27. void handleEventFingerUp(const SDL_TouchFingerEvent & current);
  28. };