InputSourceMouse.h 799 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * InputSourceMouse.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. #include "../../lib/Point.h"
  12. struct SDL_MouseWheelEvent;
  13. struct SDL_MouseMotionEvent;
  14. struct SDL_MouseButtonEvent;
  15. enum class MouseButton;
  16. /// Class that handles mouse input from SDL events
  17. class InputSourceMouse
  18. {
  19. Point middleClickPosition;
  20. int mouseButtonsMask = 0;
  21. public:
  22. void handleEventMouseMotion(const SDL_MouseMotionEvent & current);
  23. void handleEventMouseButtonDown(const SDL_MouseButtonEvent & current);
  24. void handleEventMouseWheel(const SDL_MouseWheelEvent & current);
  25. void handleEventMouseButtonUp(const SDL_MouseButtonEvent & current);
  26. };