6#ifndef EGT_DETAIL_MOUSEGESTURE_H
7#define EGT_DETAIL_MOUSEGESTURE_H
15#include <egt/detail/meta.h>
17#include <egt/geometry.h>
64 return m_mouse_start_pos;
68 EGT_NODISCARD
bool active()
const {
return m_active; }
71 EGT_NODISCARD
bool dragging()
const {
return m_dragging; }
83 return m_drag_enable_distance;
91 m_drag_enable_distance = distance;
100 bool m_active{
false};
103 bool m_dragging{
false};
106 bool m_holding{
false};
Periodic timer.
Definition timer.h:281
Basic class for interpreting mouse events.
Definition mousegesture.h:38
EGT_NODISCARD bool active() const
Is active?
Definition mousegesture.h:68
static EGT_NODISCARD DefaultDim drag_enable_distance()
Get the distance to travel to enable the drag mode.
Definition mousegesture.h:81
CallbackArray m_callbacks
Registered callback functions.
Definition mousegesture.h:115
std::vector< MouseCallback > CallbackArray
Type for array of registered callbacks.
Definition mousegesture.h:112
EGT_NODISCARD bool dragging() const
Is dragging?
Definition mousegesture.h:71
void invoke_handlers(Event &event)
Invoke an event on each of the handlers.
DisplayPoint m_mouse_start_pos
The starting position of the mouse.
Definition mousegesture.h:109
static void drag_enable_distance(DefaultDim distance)
Set the distance to travel to enable the drag mode.
Definition mousegesture.h:89
void stop()
Stop any active dragging state.
PeriodicTimer m_long_click_timer
Async timer for detecting long clicks.
Definition mousegesture.h:118
std::function< void(Event &event)> MouseCallback
Type for mouse event callback.
Definition mousegesture.h:44
static DefaultDim m_drag_enable_distance
Cursor distance to enable the drag mode.
Definition mousegesture.h:121
int DefaultDim
Define the default dimension type used for geometry.
Definition geometry.h:34
EGT framework namespace.
Definition animation.h:24
A single event that has information about the event and state for the event.
Definition event.h:255