2023-05-18 19:32:29 +02:00
|
|
|
/*
|
|
|
|
* InputSourceMouse.h, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-05-30 23:33:10 +02:00
|
|
|
#include "../../lib/Point.h"
|
|
|
|
|
2023-05-18 19:32:29 +02:00
|
|
|
struct SDL_MouseWheelEvent;
|
|
|
|
struct SDL_MouseMotionEvent;
|
|
|
|
struct SDL_MouseButtonEvent;
|
|
|
|
|
2023-05-26 14:55:31 +02:00
|
|
|
enum class MouseButton;
|
|
|
|
|
2023-05-20 00:51:10 +02:00
|
|
|
/// Class that handles mouse input from SDL events
|
2023-05-18 19:32:29 +02:00
|
|
|
class InputSourceMouse
|
|
|
|
{
|
2023-05-30 23:33:10 +02:00
|
|
|
Point middleClickPosition;
|
2023-05-26 14:55:31 +02:00
|
|
|
int mouseButtonsMask = 0;
|
2024-04-30 19:11:09 +02:00
|
|
|
const int mouseToleranceDistance;
|
2023-05-18 19:32:29 +02:00
|
|
|
public:
|
2023-07-04 19:11:16 +02:00
|
|
|
InputSourceMouse();
|
|
|
|
|
2023-05-18 19:32:29 +02:00
|
|
|
void handleEventMouseMotion(const SDL_MouseMotionEvent & current);
|
|
|
|
void handleEventMouseButtonDown(const SDL_MouseButtonEvent & current);
|
|
|
|
void handleEventMouseWheel(const SDL_MouseWheelEvent & current);
|
|
|
|
void handleEventMouseButtonUp(const SDL_MouseButtonEvent & current);
|
|
|
|
};
|