Kanzi Engine API
kanzi::KeyInputConcept Class Reference

This class defines the key gesture composing elements, key values, and key modifiers. More...

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

Inheritance diagram for kanzi::KeyInputConcept:
[legend]

Public Member Functions

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...
 

Protected Attributes

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

This class defines the key gesture composing elements, key values, and key modifiers.

A key value is one of the LogicalKey values, while a key modifier is a combination of KeyModifier enum values.

Use the KeyInputConceptImpl template class to create key gesture handler manipulators.

Since
Kanzi 3.8.0

Constructor & Destructor Documentation

kanzi::KeyInputConcept::KeyInputConcept ( )
explicitdefault

Constructor.

kanzi::KeyInputConcept::KeyInputConcept ( LogicalKey  key,
KeyModifier  modifier,
CapsLockState  caps 
)
explicit

Constructor.

kanzi::KeyInputConcept::KeyInputConcept ( LogicalKey  key,
KeyModifier  modifier 
)
explicit

Constructor.

kanzi::KeyInputConcept::KeyInputConcept ( LogicalKey  key)
explicit

Constructor.

virtual kanzi::KeyInputConcept::~KeyInputConcept ( )
virtualdefault

Destructor.

Member Function Documentation

void kanzi::KeyInputConcept::setKey ( LogicalKey  key,
KeyModifier  modifiers 
)

Sets the key gesture composing elements to handle.

Parameters
keyThe logical key value to handle.
modifiersThe key modifiers to handle. If no modifier is required, pass KeyModifier::Undefined.
void kanzi::KeyInputConcept::setKey ( LogicalKey  key)
inline

Sets the key gesture composed of a logical key value with no key modifier.

Override of the setKey() function.

Parameters
keyThe logical key value to handle.
void kanzi::KeyInputConcept::setCapsLock ( CapsLockState  capsLock)
inline

Sets the required Caps Lock state for the key gesture.

Parameters
capsLockThe state that is required for the key gesture.
Since
Kanzi 3.9.0
CapsLockState kanzi::KeyInputConcept::getCapsLock ( ) const
inline

Returns the required Caps Lock state for the key gesture.

Since
Kanzi 3.9.0
pair<LogicalKey, KeyModifier> kanzi::KeyInputConcept::getKey ( ) const

Returns the composing elements of a key gesture.

Returns
A pair containing the logical key as the first, and the key modifiers as the second field.
bool kanzi::KeyInputConcept::isGrabbed ( ) const
inline

Returns the grabbed state of a key gesture.

Returns
If the key gesture is grabbed, returns true, otherwise false.
void kanzi::KeyInputConcept::setGrabbed ( bool  grabbed)
inline

Sets the grabbed state of the key gesture.

Parameters
grabbedThe new grabbed state of the key gesture.
Since
Kanzi 3.9.0
bool kanzi::KeyInputConcept::isEnabled ( ) const
inline

Returns the enabled state of a key gesture.

Returns
If the key gesture is enabled, returns true, otherwise false.
Since
Kanzi 3.9.0
void kanzi::KeyInputConcept::setEnabled ( bool  enabled)
inline

Sets the enabled state of the key gesture.

Parameters
enabledThe new enabled state of the key gesture.
Since
Kanzi 3.9.0
bool kanzi::KeyInputConcept::isCapsLockGrabbed ( ) const
inline

Returns whether the Caps Lock mode was on when the gesture detector set this key gesture as grabbed.

Returns
If the Caps Lock mode was on when the gesture detector set this key gesture as grabbed, returns true, otherwise false.
Since
Kanzi 3.9.0
void kanzi::KeyInputConcept::setCapsLockGrabbed ( bool  capsLock)
inline

Sets whether the Caps Lock mode of the keyboard is on at the time Kanzi grabs the key gesture.

Parameters
capsLockWhether the Caps Lock mode is on at the time Kanzi grabs the key gesture.
Since
Kanzi 3.9.0

Member Data Documentation

LogicalKey kanzi::KeyInputConcept::m_code
protected

The logical key value.

KeyModifier kanzi::KeyInputConcept::m_modifiers
protected

The key modifiers.

CapsLockState kanzi::KeyInputConcept::m_capsLockState
protected

Holds the required Caps Lock state for the key gesture.

bool kanzi::KeyInputConcept::m_isGrabbed
protected

Holds the grabbed state of a gesture.

bool kanzi::KeyInputConcept::m_isEnabled
protected

Holds the enabled state of a gesture.

bool kanzi::KeyInputConcept::m_capsLock
protected

Holds the Caps Lock state at the time Kanzi grabs the key gesture.


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