KWin
|
#include <shakedetector.h>
Public Member Functions | |
ShakeDetector () | |
std::optional< qreal > | update (QMouseEvent *event) |
quint64 | interval () const |
void | setInterval (quint64 interval) |
qreal | sensitivity () const |
void | setSensitivity (qreal sensitivity) |
The ShakeDetector type provides a way to detect pointer shake gestures.
Shake gestures are detected by comparing the length of the trail of the cursor within past N milliseconds with the length of the diagonal of the bounding rectangle of the trail. If the trail is longer than the diagonal by certain preconfigured factor, it's assumed that the user shook the pointer.
Definition at line 21 of file shakedetector.h.
ShakeDetector::ShakeDetector | ( | ) |
Definition at line 11 of file shakedetector.cpp.
quint64 ShakeDetector::interval | ( | ) | const |
Definition at line 15 of file shakedetector.cpp.
qreal ShakeDetector::sensitivity | ( | ) | const |
Definition at line 25 of file shakedetector.cpp.
void ShakeDetector::setInterval | ( | quint64 | interval | ) |
Definition at line 20 of file shakedetector.cpp.
void ShakeDetector::setSensitivity | ( | qreal | sensitivity | ) |
Definition at line 30 of file shakedetector.cpp.
std::optional< qreal > ShakeDetector::update | ( | QMouseEvent * | event | ) |
Definition at line 35 of file shakedetector.cpp.