Kanzi Engine API
kanzi::TextInputManipulator::KeyGesture Class Reference

Inner class that Kanzi uses to detect hardware key gestures and to invoke a function associated with a specific key. More...

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

Inheritance diagram for kanzi::TextInputManipulator::KeyGesture:
[legend]

Public Types

using KeyGestureFunction) = void(TextInputManipulator::*)(
 Type of the function associated to a key gesture. More...
 

Public Member Functions

void cancel ()
 Cancels the key-pressed and key-released gestures for the cursor navigation keys. More...
 
 KeyGesture (LogicalKey key, KeyModifier modifier, TextInputManipulator &manipulator, KeyGestureFunction onPressed, KeyGestureFunction onReleased, KeyGestureFunction onCanceled, bool allowedOnReadOnly)
 Constructor. More...
 
void notifyKeyPressGesture (KeyInputConcept &)
 KeyInputConceptImpl calls this method to notify a key manipulator that Kanzi recognized a full key-pressed gesture. More...
 
void notifyKeyReleaseGesture (KeyInputConcept &)
 KeyInputConceptImpl calls this method to notify a key manipulator that Kanzi recognized a key-released gesture. More...
 
void notifyPartialKeyPressGesture (KeyInputConcept &)
 KeyInputConceptImpl calls this method to notify a key manipulator that Kanzi recognized a partial key-pressed gesture. More...
 
void onPress ()
 Activates the function associated to the key press gesture. More...
 
void onRelease ()
 Activates the function associated to the key release gesture. More...
 
void reset ()
 Resets the key-pressed and key-released gestures for the cursor navigation keys. More...
 
- Public Member Functions inherited from kanzi::KeyInputConceptImpl< KeyGesture >
bool detectKeyGesture (const KeyEvent &event)
 Detects key gestures from the event that you pass as an argument. More...
 
- Public Member Functions inherited from kanzi::KeyInputConcept
CapsLockState getCapsLock () const
 Returns the required Caps Lock state for the key gesture. More...
 
pair< LogicalKey, KeyModifiergetKey () const
 Returns the composing elements of a key gesture. More...
 
bool isCapsLockGrabbed () const
 Returns whether the Caps Lock mode was on when the gesture detector set this key gesture as grabbed. More...
 
bool isEnabled () const
 Returns the enabled state of a key gesture. More...
 
bool isGrabbed () const
 Returns the grabbed state of a key gesture. More...
 
 KeyInputConcept ()=default
 Constructor. More...
 
 KeyInputConcept (LogicalKey key, KeyModifier modifier, CapsLockState caps)
 Constructor. More...
 
 KeyInputConcept (LogicalKey key, KeyModifier modifier)
 Constructor. More...
 
 KeyInputConcept (LogicalKey key)
 Constructor. More...
 
void setCapsLock (CapsLockState capsLock)
 Sets the required Caps Lock state for the key gesture. More...
 
void setCapsLockGrabbed (bool capsLock)
 Sets whether the Caps Lock mode of the keyboard is on at the time Kanzi grabs the key gesture. More...
 
void setEnabled (bool enabled)
 Sets the enabled state of the key gesture. More...
 
void setGrabbed (bool grabbed)
 Sets the grabbed state of the key gesture. More...
 
void setKey (LogicalKey key, KeyModifier modifiers)
 Sets the key gesture composing elements to handle. More...
 
void setKey (LogicalKey key)
 Sets the key gesture composed of a logical key value with no key modifier. More...
 
virtual ~KeyInputConcept ()=default
 Destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from kanzi::KeyInputConceptImpl< KeyGesture >
void grabGesture ()
 Grabs the gesture. More...
 
 KeyInputConceptImpl ()=default
 Constructor. More...
 
void ungrabGesture ()
 Ungrabs the gesture. More...
 
- Protected Member Functions inherited from kanzi::KeyInputGestureDetector< KeyGesture, KeyInputConcept >
bool detectKeyGesture (const KeyEvent &event, KeyInputConcept &gesture)
 Detects key gestures from the event that you pass as an argument. More...
 
void grabGesture (KeyInputConcept &gesture)
 Grabs a gesture. More...
 
 KeyInputGestureDetector ()=default
 Constructor. More...
 
void ungrabGesture (KeyInputConcept &gesture)
 Ungrabs a gesture. More...
 
- Protected Attributes inherited from kanzi::KeyInputConcept
bool m_capsLock
 Holds the Caps Lock state at the time Kanzi grabs the key gesture. More...
 
CapsLockState m_capsLockState
 Holds the required Caps Lock state for the key gesture. More...
 
LogicalKey m_code
 The logical key value. More...
 
bool m_isEnabled
 Holds the enabled state of a gesture. More...
 
bool m_isGrabbed
 Holds the grabbed state of a gesture. More...
 
KeyModifier m_modifiers
 The key modifiers. More...
 

Detailed Description

Inner class that Kanzi uses to detect hardware key gestures and to invoke a function associated with a specific key.

Member Typedef Documentation

using kanzi::TextInputManipulator::KeyGesture::KeyGestureFunction = void (TextInputManipulator::*)(

Type of the function associated to a key gesture.

Constructor & Destructor Documentation

kanzi::TextInputManipulator::KeyGesture::KeyGesture ( LogicalKey  key,
KeyModifier  modifier,
TextInputManipulator manipulator,
KeyGestureFunction  onPressed,
KeyGestureFunction  onReleased,
KeyGestureFunction  onCanceled,
bool  allowedOnReadOnly 
)
explicit

Constructor.

Creates an instance of a key gesture detection.

Parameters
keyThe logical key value to handle.
keyThe key modifier values to handle.
manipulatorThe manipulator that owns this key gesture.
onPressedThe function to call when the key is pressed. Pass nullptr to ignore the gesture.
onReleasedThe function to call when the key is released. Pass nullptr to ignore the gesture.
onCanceledThe function to call when the key gesture is canceled. Pass nullptr to ignore the gesture.
allowedOnReadOnlyIf the key handling is allowed on read-only text input manipulators, pass true as argument. If the key handling is forbidden on read-only text input manipulators, pass .

Member Function Documentation

void kanzi::TextInputManipulator::KeyGesture::cancel ( )

Cancels the key-pressed and key-released gestures for the cursor navigation keys.

void kanzi::TextInputManipulator::KeyGesture::reset ( )
inline

Resets the key-pressed and key-released gestures for the cursor navigation keys.

void kanzi::TextInputManipulator::KeyGesture::onPress ( )
inline

Activates the function associated to the key press gesture.

void kanzi::TextInputManipulator::KeyGesture::onRelease ( )
inline

Activates the function associated to the key release gesture.

void kanzi::TextInputManipulator::KeyGesture::notifyPartialKeyPressGesture ( KeyInputConcept )

KeyInputConceptImpl calls this method to notify a key manipulator that Kanzi recognized a partial key-pressed gesture.

void kanzi::TextInputManipulator::KeyGesture::notifyKeyPressGesture ( KeyInputConcept )

KeyInputConceptImpl calls this method to notify a key manipulator that Kanzi recognized a full key-pressed gesture.

void kanzi::TextInputManipulator::KeyGesture::notifyKeyReleaseGesture ( KeyInputConcept )

KeyInputConceptImpl calls this method to notify a key manipulator that Kanzi recognized a key-released gesture.


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