KWin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
ShakeDetector Class Reference

#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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ShakeDetector()

ShakeDetector::ShakeDetector ( )

Definition at line 11 of file shakedetector.cpp.

Member Function Documentation

◆ interval()

quint64 ShakeDetector::interval ( ) const

Definition at line 15 of file shakedetector.cpp.

◆ sensitivity()

qreal ShakeDetector::sensitivity ( ) const

Definition at line 25 of file shakedetector.cpp.

◆ setInterval()

void ShakeDetector::setInterval ( quint64 interval)

Definition at line 20 of file shakedetector.cpp.

◆ setSensitivity()

void ShakeDetector::setSensitivity ( qreal sensitivity)

Definition at line 30 of file shakedetector.cpp.

◆ update()

std::optional< qreal > ShakeDetector::update ( QMouseEvent * event)

Definition at line 35 of file shakedetector.cpp.


The documentation for this class was generated from the following files: