Kanzi Engine API
kanzi::KeyInputGestureDetector< TDerivedClass, TKeyGesture > Class Template Reference

This template class enables you to implement generic key gestures recognition. More...

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

Inheritance diagram for kanzi::KeyInputGestureDetector< TDerivedClass, TKeyGesture >:
[legend]

Protected Member Functions

bool detectKeyGesture (const KeyEvent &event, TKeyGesture &gesture)
 Detects key gestures from the event that you pass as an argument. More...
 
void grabGesture (TKeyGesture &gesture)
 Grabs a gesture. More...
 
 KeyInputGestureDetector ()=default
 Constructor. More...
 
void ungrabGesture (TKeyGesture &gesture)
 Ungrabs a gesture. More...
 

Detailed Description

template<typename TDerivedClass, typename TKeyGesture>
class kanzi::KeyInputGestureDetector< TDerivedClass, TKeyGesture >

This template class enables you to implement generic key gestures recognition.

Kanzi supports these types of key gestures:

  • Partial key-pressed gesture is when Kanzi recognizes a key event that contains only a part of the elements that compose that gesture.
  • Full key-pressed gesture occurs when Kanzi recognizes a key event that contains all the elements that compose that gesture.
  • Key-released gesture occurs when Kanzi recognizes the release of one of the elements that compose that gesture.
  • Key-repeat gesture occurs when Kanzi does not detect a key-released gesture.

To support all of these gestures, use this template class in combination with the KeyRepeatConceptImpl template class.

Template Parameters
TDerivedClassThe derived key gesture detector class. Your class must have these methods:
  • void notifyPartialKeyPressGesture(KeyInputConcept&)
  • void notifyKeyPressGesture(KeyInputConcept&)
  • void notifyKeyReleaseGesture(KeyInputConcept&)
TKeyGestureThe class that defines the key gesture. The class must have these methods:
  • bool isGrabbed() const
  • void setGrabbed()
  • CapsLockState getCapsLock() const
  • pair<LogicalKey, KeyModifier> getKey() const
Since
Kanzi 3.9.0

Constructor & Destructor Documentation

template<typename TDerivedClass, typename TKeyGesture>
kanzi::KeyInputGestureDetector< TDerivedClass, TKeyGesture >::KeyInputGestureDetector ( )
explicitprotecteddefault

Constructor.

Member Function Documentation

template<typename TDerivedClass , typename TKeyGesture>
bool kanzi::KeyInputGestureDetector< TDerivedClass, TKeyGesture >::detectKeyGesture ( const KeyEvent event,
TKeyGesture &  gesture 
)
protected

Detects key gestures from the event that you pass as an argument.

Call this method to detect a key gesture from a key event.

Parameters
eventThe event to detect the key gesture.
gestureThe structure with the gesture data.
Returns
If the key event matches the key gesture, returns true. If the key does not match the gesture, or only partially matches it, returns false.
template<typename TDerivedClass , typename TKeyGesture>
void kanzi::KeyInputGestureDetector< TDerivedClass, TKeyGesture >::grabGesture ( TKeyGesture &  gesture)
protected

Grabs a gesture.

Parameters
gestureThe structure with the gesture data.
template<typename TDerivedClass , typename TKeyGesture>
void kanzi::KeyInputGestureDetector< TDerivedClass, TKeyGesture >::ungrabGesture ( TKeyGesture &  gesture)
protected

Ungrabs a gesture.

Parameters
gestureThe structure with the gesture data.

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