#include <Gestures.h>
|
| Gestures () |
|
void | update () |
|
void | setDisplayScale (float scale) |
|
void | pointerDown (PointerType pointerType, PointerId pointerId, MouseButton button, glm::ivec2 position, double timestamp_ms) |
|
void | pointerUp (PointerType pointerType, PointerId pointerId, MouseButton button, glm::ivec2 position, double timestamp_ms) |
|
void | pointerMove (PointerType pointerType, PointerId pointerId, glm::ivec2 position, double timestamp_ms) |
|
void | mouseWheelMove (int32_t delta) |
|
void | reset () |
|
PointerType | getPointerType () |
| Get the type of pointer that was last registered.
|
|
const std::vector< Gesture > & | getGestures () const |
| Return all gestures recognised in the previous frame. Use id to differentiate between gestures.
|
|
|
bool | hoverEnable = true |
| Allow/disallow hover gesture.
|
|
bool | wheelEnable = true |
| Allow/disallow mouse wheel gesture.
|
|
bool | tapEnable = true |
| Allow/disallow tap gesture.
|
|
bool | doubleTapEnable = true |
| Allow/disallow double tap gesture.
|
|
bool | pressEnable = true |
| Allow/disallow press gesture.
|
|
bool | dragEnable = true |
| Allow/disallow drag gesture.
|
|
bool | swipeEnable = true |
| Allow/disallow swipe gesture.
|
|
bool | panEnable = true |
| Allow/disallow pan gesture.
|
|
bool | rotateEnable = true |
| Allow/disallow rotate gesture.
|
|
bool | pinchEnable = true |
| Allow/disallow pinch gesture.
|
|
uint32_t | tapMaxDuration = 250 |
| Millisecond threshold between classifying a press as a press or a tap.
|
|
uint32_t | doubleTapTreshold = 300 |
| Number of milliseconds between taps to be classified as a single double tap event.
|
|
uint32_t | swipeMaxDuration = 200 |
| Millisecond threshold between classifying a drag as a drag or a swipe.
|
|
float | mouseMoveThreshold = 1.f |
| Mouse pixel movement threshold before classifying move-based gestures.
|
|
float | touchMoveThreshold = 16.f |
| Touch pixel movement threshold before classifying move-based gestures.
|
|
float | touchVelocityThreshold = 500.f |
| Touch movement threshold between a swipe or a drag, in pixels/s.
|
|
float | mouseVelocityThreshold = 100.f |
| Mouse movement threshold between a swipe or a drag, in pixels/s.
|
|
float | rotateThreshold = 0.05f |
| Threshold in radians before classifying a gesture as a rotation.
|
|
float | pinchThreshold = 0.1f |
| Threshold of relative change before classifying a gesture as a pinch.
|
|
◆ Gestures()
Cogs::Gestures::Gestures |
( |
| ) |
|
◆ endUpdatingGesture()
◆ getGestures()
const std::vector< Gesture > & Cogs::Gestures::getGestures |
( |
| ) |
const |
|
inline |
Return all gestures recognised in the previous frame. Use id to differentiate between gestures.
◆ getPointerType()
Get the type of pointer that was last registered.
◆ mouseWheelMove()
void Cogs::Gestures::mouseWheelMove |
( |
int32_t |
delta | ) |
|
◆ nextGestureId()
uint32_t Cogs::Gestures::nextGestureId |
( |
| ) |
|
|
inlineprivate |
◆ pointerDown()
References Cogs::Gestures::PointerState::button, Cogs::Gesture::Cancelled, Cogs::Gestures::PointerState::curr, Cogs::Gesture::Drag, Cogs::Gesture::id, Cogs::Gestures::PointerState::init, Cogs::Gesture::Pan, Cogs::Gesture::Pinch, Cogs::Gestures::PointerState::Data::position, Cogs::Gesture::Press, Cogs::Gestures::PointerState::prev, Cogs::Gesture::Rotate, Cogs::Gesture::Started, Cogs::Gestures::PointerState::state, Cogs::Gestures::PointerState::Data::timestamp_ms, and Cogs::Gestures::PointerState::type.
◆ pointerMove()
void Cogs::Gestures::pointerMove |
( |
PointerType |
pointerType, |
|
|
PointerId |
pointerId, |
|
|
glm::ivec2 |
position, |
|
|
double |
timestamp_ms |
|
) |
| |
References Cogs::Gesture::Cancelled, Cogs::Gesture::Changed, Cogs::Gestures::PointerState::curr, Cogs::Gesture::Ended, Cogs::Gesture::Hover, Cogs::Gesture::id, Cogs::Gestures::PointerState::init, Cogs::Mouse, Cogs::Gestures::PointerState::Data::position, Cogs::Gestures::PointerState::prev, Cogs::Gesture::Started, Cogs::Gestures::PointerState::state, Cogs::Gestures::PointerState::Data::timestamp_ms, Cogs::Gesture::Coord::x, and Cogs::Gesture::Coord::y.
◆ pointerUp()
References Cogs::Gesture::Cancelled, Cogs::Gesture::Changed, Cogs::Gestures::PointerState::curr, Cogs::Gesture::DoubleTap, Cogs::Gesture::Swipe::Down, Cogs::Gesture::Ended, Cogs::Gesture::id, Cogs::Gestures::PointerState::init, Cogs::Gesture::Swipe::Left, LOG_WARNING, Cogs::logger, Cogs::Mouse, Cogs::Gestures::PointerState::Data::position, Cogs::Gesture::Swipe::Right, Cogs::Gestures::PointerState::state, Cogs::Gesture::Swipe, Cogs::Gesture::Tap, Cogs::Gestures::PointerState::Data::timestamp_ms, and Cogs::Gesture::Swipe::Up.
◆ reset()
void Cogs::Gestures::reset |
( |
| ) |
|
◆ setDisplayScale()
void Cogs::Gestures::setDisplayScale |
( |
float |
scale | ) |
|
|
inline |
◆ update()
void Cogs::Gestures::update |
( |
| ) |
|
◆ currDrag
std::optional<Gesture> Cogs::Gestures::currDrag = std::nullopt |
|
private |
◆ currentGestures
std::vector<Gesture> Cogs::Gestures::currentGestures |
|
private |
◆ currentPointers
Set of currently active pointers.
Referenced by Gestures().
◆ currPan
std::optional<Gesture> Cogs::Gestures::currPan = std::nullopt |
|
private |
◆ currPinch
std::optional<Gesture> Cogs::Gestures::currPinch = std::nullopt |
|
private |
◆ currPointerType
◆ currPress
std::optional<Gesture> Cogs::Gestures::currPress = std::nullopt |
|
private |
◆ currRotate
std::optional<Gesture> Cogs::Gestures::currRotate = std::nullopt |
|
private |
◆ displayScale
float Cogs::Gestures::displayScale = 1.0f |
|
private |
◆ doubleTapEnable
bool Cogs::Gestures::doubleTapEnable = true |
Allow/disallow double tap gesture.
◆ doubleTapTreshold
uint32_t Cogs::Gestures::doubleTapTreshold = 300 |
Number of milliseconds between taps to be classified as a single double tap event.
◆ dragEnable
bool Cogs::Gestures::dragEnable = true |
Allow/disallow drag gesture.
◆ hoverEnable
bool Cogs::Gestures::hoverEnable = true |
Allow/disallow hover gesture.
◆ idCounter
uint32_t Cogs::Gestures::idCounter = 0 |
|
private |
◆ lastTapTimestamp
double Cogs::Gestures::lastTapTimestamp = 0 |
|
private |
◆ mouseMoveThreshold
float Cogs::Gestures::mouseMoveThreshold = 1.f |
Mouse pixel movement threshold before classifying move-based gestures.
◆ mouseVelocityThreshold
float Cogs::Gestures::mouseVelocityThreshold = 100.f |
Mouse movement threshold between a swipe or a drag, in pixels/s.
Touch duration is also a factor, see swipeMaxDuration.
◆ panEnable
bool Cogs::Gestures::panEnable = true |
Allow/disallow pan gesture.
◆ pinchEnable
bool Cogs::Gestures::pinchEnable = true |
Allow/disallow pinch gesture.
◆ pinchThreshold
float Cogs::Gestures::pinchThreshold = 0.1f |
Threshold of relative change before classifying a gesture as a pinch.
◆ presentedGestures
std::vector<Gesture> Cogs::Gestures::presentedGestures |
|
private |
◆ pressEnable
bool Cogs::Gestures::pressEnable = true |
Allow/disallow press gesture.
◆ rotateEnable
bool Cogs::Gestures::rotateEnable = true |
Allow/disallow rotate gesture.
◆ rotateThreshold
float Cogs::Gestures::rotateThreshold = 0.05f |
Threshold in radians before classifying a gesture as a rotation.
◆ swipeEnable
bool Cogs::Gestures::swipeEnable = true |
Allow/disallow swipe gesture.
◆ swipeMaxDuration
uint32_t Cogs::Gestures::swipeMaxDuration = 200 |
◆ tapEnable
bool Cogs::Gestures::tapEnable = true |
Allow/disallow tap gesture.
◆ tapMaxDuration
uint32_t Cogs::Gestures::tapMaxDuration = 250 |
Millisecond threshold between classifying a press as a press or a tap.
◆ touchMoveThreshold
float Cogs::Gestures::touchMoveThreshold = 16.f |
Touch pixel movement threshold before classifying move-based gestures.
◆ touchVelocityThreshold
float Cogs::Gestures::touchVelocityThreshold = 500.f |
Touch movement threshold between a swipe or a drag, in pixels/s.
Touch duration is also a factor, see swipeMaxDuration.
◆ wheelEnable
bool Cogs::Gestures::wheelEnable = true |
Allow/disallow mouse wheel gesture.
The documentation for this class was generated from the following files: