Kanzi  3.9.6
Kanzi Engine API
kanzi::KeyMap Struct Reference

Defines the keys to map from a {LogicalKey, KeyModifier} pair to a simple LogicalKey. More...

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

Public Member Functions

 KeyMap (LogicalKey sourceKey, KeyModifier sourceModifier, LogicalKey targetKey)
 Constructor. More...
 

Public Attributes

LogicalKey sourceKey
 The source logical key value. More...
 
KeyModifier sourceModifier
 The source key modifier value. More...
 
LogicalKey targetKey
 The target logical key value. More...
 

Detailed Description

Defines the keys to map from a {LogicalKey, KeyModifier} pair to a simple LogicalKey.

KeyMapEventFilter uses this to translate key events.

Kanzi translates system key events to a platform-independent {LogicalKey, KeyModifier} pair. Input Manipulators translate these key events into key messages, passing the LogicalKey and KeyModifier as message arguments.

When Kanzi translates a key, the sourceKey and the sourceModifier must match with the translated key. When that happens, Kanzi translates the key so that the additional modifiers from the original key event are added to the translated key event.

For example, the {LogicalKey::Tab, KeyModifier::Shift} translation to LogicalKey::BackTab translates the {LogicalKey::Tab, KeyModifier::Shift + KeyModifier::Control} key event into {LogicalKey::BackTab, KeyModifier::Control}.

To create an application that is based on key messages with LogicalKey argument only, specify the key conversion map in the EventSourceProperties::keyMap by overriding the Application::onConfigure() method.

See also
ApplicationProperties, Application::onConfigure(), KeyMapEventFilter
Since
Kanzi 3.9.0

Constructor & Destructor Documentation

◆ KeyMap()

kanzi::KeyMap::KeyMap ( LogicalKey  sourceKey,
KeyModifier  sourceModifier,
LogicalKey  targetKey 
)
inlineexplicit

Constructor.

Member Data Documentation

◆ sourceKey

LogicalKey kanzi::KeyMap::sourceKey

The source logical key value.

◆ sourceModifier

KeyModifier kanzi::KeyMap::sourceModifier

The source key modifier value.

◆ targetKey

LogicalKey kanzi::KeyMap::targetKey

The target logical key value.


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