84 QString GetName ()
const;
88 Qt::MouseButton
GetButton ()
const {
return m_button; }
89 QString GetButtonName()
const;
96 Qt::MouseButton m_button { Qt::NoButton };
102 explicit MythGesture(
size_t MaxPoints = 10000,
size_t MinPoints = 50,
103 size_t MaxSequence = 20,
int ScaleRatio = 4,
104 float BinPercent = 0.07F);
107 void Stop(
bool Timeout =
false);
110 bool Record(QPoint Point, Qt::MouseButton Button);
132 static const std::map<QString, MythGestureEvent::Gesture>
kSequences;
A custom event that represents a mouse gesture.
void SetPosition(QPoint Position)
~MythGestureEvent() override=default
static const Type kEventType
Gesture GetGesture() const
QPoint GetPosition() const
Qt::MouseButton GetButton() const
Contains the points in a stroke, and translates them into gestures.
bool Record(QPoint Point, Qt::MouseButton Button)
Record a point.
bool HasMinimumPoints() const
Determine if the stroke has the minimum required points.
MythGestureEvent * GetGesture() const
Complete the gesture event of the last completed stroke.
bool Recording()
Determine if the stroke is being recorded.
MythGestureEvent::Gesture m_lastGesture
void Start()
Start recording.
static const std::map< QString, MythGestureEvent::Gesture > kSequences
MythGesture(size_t MaxPoints=10000, size_t MinPoints=50, size_t MaxSequence=20, int ScaleRatio=4, float BinPercent=0.07F)
Create a new stroke, specifying tuning values.
Qt::MouseButton m_lastButton
void Stop(bool Timeout=false)
Stop recording.
void AdjustExtremes(int X, int Y)
Adjust horizontal and vertical extremes.
QString Translate(bool Timeout)
Translate the stroke into a sequence.