mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-14 10:12:59 +02:00
35 lines
856 B
C++
35 lines
856 B
C++
/*
|
|
* 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
|
|
|
|
#include "../../lib/Point.h"
|
|
|
|
struct SDL_MouseWheelEvent;
|
|
struct SDL_MouseMotionEvent;
|
|
struct SDL_MouseButtonEvent;
|
|
|
|
enum class MouseButton;
|
|
|
|
/// Class that handles mouse input from SDL events
|
|
class InputSourceMouse
|
|
{
|
|
Point middleClickPosition;
|
|
int mouseButtonsMask = 0;
|
|
const int mouseToleranceDistance;
|
|
public:
|
|
InputSourceMouse();
|
|
|
|
void handleEventMouseMotion(const SDL_MouseMotionEvent & current);
|
|
void handleEventMouseButtonDown(const SDL_MouseButtonEvent & current);
|
|
void handleEventMouseWheel(const SDL_MouseWheelEvent & current);
|
|
void handleEventMouseButtonUp(const SDL_MouseButtonEvent & current);
|
|
};
|