Kanzi Engine API
kanzi::KeyRepeatConcept Class Reference

The KeyRepeatConcept class defines the key-repeat gesture handling in Kanzi. More...

#include <kanzi/core.ui/input/key_input_concept.hpp>

Inheritance diagram for kanzi::KeyRepeatConcept:
[legend]

Public Types

enum  DetectionMode : uint8_t { DetectionMode::Disabled, DetectionMode::KeyHold, DetectionMode::KeyHoldAndRepeat }
 Specifies the key-hold and key-repeat gesture detection mode. More...
 

Public Member Functions

chrono::milliseconds getKeyHoldTimeout () const
 Returns the time, in milliseconds, that Kanzi waits before it detects a key-hold gesture. More...
 
DetectionMode getKeyRepeatDetectionMode () const
 Returns the current key-hold and key-repeat gesture detection mode. More...
 
chrono::milliseconds getKeyRepeatInterval () const
 Returns the time, in milliseconds, between key-repeat gesture notifications that Kanzi sends repeatedly. More...
 
void setKeyHoldTimeout (chrono::milliseconds timeout)
 Sets the time that Kanzi waits to detect a key-hold gesture. More...
 
void setKeyRepeatInterval (chrono::milliseconds interval)
 Sets the time between the key-repeat gesture notifications that Kanzi sends repeatedly. More...
 
virtual ~KeyRepeatConcept ()=default
 Destructor. More...
 

Protected Member Functions

 KeyRepeatConcept ()=default
 Constructor. More...
 

Protected Attributes

DetectionMode m_detectionMode
 Holds the key-repeat setting of the key gesture. More...
 
chrono::milliseconds m_keyHoldTimeout
 Key-hold timeout. More...
 
MainLoopTimerToken m_keyHoldTimerSubscription
 Timer handle for the initial key-hold and the key-repeat interval. More...
 
chrono::milliseconds m_keyRepeatInterval
 Key-repeat interval. More...
 

Detailed Description

The KeyRepeatConcept class defines the key-repeat gesture handling in Kanzi.

The class holds the methods that enable you to handle key-repeat gestures in your manipulator.

You can use the key-repeat gesture detection mechanism by deriving your class from the KeyRepeatConceptImpl template class.

Since
Kanzi 3.8.0

Member Enumeration Documentation

Specifies the key-hold and key-repeat gesture detection mode.

Enumerator
Disabled 

The key-hold and key-repeat gesture detection is disabled.

KeyHold 

Handle only key-hold gestures.

KeyHoldAndRepeat 

Handle both key-hold and key-repeat gestures.

Constructor & Destructor Documentation

virtual kanzi::KeyRepeatConcept::~KeyRepeatConcept ( )
virtualdefault

Destructor.

kanzi::KeyRepeatConcept::KeyRepeatConcept ( )
explicitprotecteddefault

Constructor.

Member Function Documentation

DetectionMode kanzi::KeyRepeatConcept::getKeyRepeatDetectionMode ( ) const
inline

Returns the current key-hold and key-repeat gesture detection mode.

Returns
The current key-hold and key-repeat gesture detection mode. The default value is #KeyHoldAndRepeat.
chrono::milliseconds kanzi::KeyRepeatConcept::getKeyHoldTimeout ( ) const

Returns the time, in milliseconds, that Kanzi waits before it detects a key-hold gesture.

Returns
The time, in milliseconds, that Kanzi waits before it detects a key-hold gesture. The default is 500 milliseconds.
void kanzi::KeyRepeatConcept::setKeyHoldTimeout ( chrono::milliseconds  timeout)

Sets the time that Kanzi waits to detect a key-hold gesture.

Parameters
timeoutThe time, in milliseconds, that Kanzi waits to detect a key-hold gesture. This value must be greater than zero.
chrono::milliseconds kanzi::KeyRepeatConcept::getKeyRepeatInterval ( ) const

Returns the time, in milliseconds, between key-repeat gesture notifications that Kanzi sends repeatedly.

The key-repeat gesture detection follows after Kanzi detects a key-hold gesture.

Returns
The time, in milliseconds, that Kanzi waits between key-repeat gesture notifications. The default is 100 milliseconds.
void kanzi::KeyRepeatConcept::setKeyRepeatInterval ( chrono::milliseconds  interval)

Sets the time between the key-repeat gesture notifications that Kanzi sends repeatedly.

Parameters
intervalThe time, in milliseconds, that Kanzi waits between key-repeat gesture notifications. This value must be greater than zero.

Member Data Documentation

MainLoopTimerToken kanzi::KeyRepeatConcept::m_keyHoldTimerSubscription
protected

Timer handle for the initial key-hold and the key-repeat interval.

chrono::milliseconds kanzi::KeyRepeatConcept::m_keyHoldTimeout
protected

Key-hold timeout.

chrono::milliseconds kanzi::KeyRepeatConcept::m_keyRepeatInterval
protected

Key-repeat interval.

DetectionMode kanzi::KeyRepeatConcept::m_detectionMode
protected

Holds the key-repeat setting of the key gesture.


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