Kanzi framework  3.9.1
Kanzi Engine API
Input and Focus

Input and focus handling. More...

Collaboration diagram for Input and Focus:

Classes

class  kanzi::ClickConcept
 Use the ClickConcept properties to control how nodes handle click and double-click. More...
 
class  kanzi::ClickConceptImpl< TBaseClass, TDerivedClass >
 Implementation of base Click Concept class for derived classes. More...
 
class  kanzi::ClickManipulator
 Click input manipulator recognizes the click and tap gestures from the incoming touch events. More...
 
class  kanzi::ClickManipulatorComponent
 ClickManipulatorComponent installs a ClickManipulator to a node. More...
 
class  kanzi::DragAndDropManipulator
 Drag and drop input manipulator recognizes the drag and drop gesture from incoming touch events. More...
 
class  kanzi::EventFilter
 EventFilter class. More...
 
class  kanzi::EventQueue
 The EventQueue class implements a queue of Kanzi input events gathered by EventSource instances. More...
 
class  kanzi::EventSource
 EventSource class. More...
 
class  kanzi::EventSourceDecorator
 The EventSourceDecorator declares the interface for the EventSource decorators. More...
 
struct  kanzi::EventSourceProperties
 Configurable event source properties. More...
 
struct  kanzi::FocusChainIndex
 Contains the focus order and focus order offset information of a node in a focus scope. More...
 
struct  kanzi::FocusChainNode
 The focus chain node of a focus scope consists of the node of the focus scope, its focus order, and the focus order offset. More...
 
class  kanzi::FocusFence
 Implements the focus fences. More...
 
class  kanzi::FocusGroup
 Implements the focus groups. More...
 
class  kanzi::FocusManager
 Focus Manager enables you to set and change the keyboard focus between attached nodes. More...
 
struct  kanzi::FocusNavigationGesture
 Declares a focus navigation gesture. More...
 
class  kanzi::FocusNavigationManipulator
 FocusNavigationManipulator converts key gestures into focus chain navigation actions to move the focus between focusable nodes. More...
 
class  kanzi::FocusScope
 The FocusScope class holds the attributes of a focus scope: More...
 
class  kanzi::FocusScopeVisitor
 Focus scope visitor for UI scene traversal of focus scopes. More...
 
class  kanzi::InputManager
 InputManager converts the events from the given event queue into input specific messages. More...
 
class  kanzi::InputManipulator
 The base class for the Kanzi input manipulators. More...
 
class  kanzi::KeyManipulator
 KeyManipulator class is a key input manipulator that detects key gestures. More...
 
class  kanzi::KeyManipulatorComponent
 The KeyManipulatorComponent node component installs a KeyManipulator to the attached node, and configures the key gesture of the manipulator. More...
 
struct  kanzi::KeyMap
 Defines the keys to map from a {LogicalKey, KeyModifier} pair to a simple LogicalKey. More...
 
class  kanzi::KeyMapEventFilter
 The KeyMapEventFilter provides key translation in Kanzi. More...
 
class  kanzi::KeyRepeatGenerator
 The KeyRepeatGenerator is an event source decorator that scans the event queue of the EventSource it extends for key-press events and generates from them key-press repetitions. More...
 
class  kanzi::LongPressManipulator
 Long-press input manipulator recognizes the long-press gesture from the incoming touch events. More...
 
class  kanzi::LongPressManipulatorComponent
 LongPressManipulatorComponent installs a LongPressManipulator to a node. More...
 
class  kanzi::ModalScope
 Implements the modal scopes. More...
 
class  kanzi::MultiClickManipulator
 Multi-click input manipulator recognizes multi-click and multi-tap gestures from incoming touch events. More...
 
class  kanzi::MultiClickManipulatorComponent
 MultiClickManipulatorComponent installs a MultiClickManipulator to a node. More...
 
class  kanzi::NavigationManipulator
 The NavigationManipulator supports these navigation directions and default keyboard keys for them: More...
 
class  kanzi::NavigationManipulatorComponent
 The NavigationManipulatorComponent node component installs a NavigationManipulator to a node, and configures the navigation key gestures of the manipulator. More...
 
class  kanzi::PanManipulator
 Pan input manipulator recognizes a pan gesture from the incoming touch events. More...
 
class  kanzi::PanManipulatorComponent
 PanManipulatorComponent installs a PanManipulator to a node. More...
 
class  kanzi::PinchManipulator
 Pinch input manipulator recognizes the pinch gesture from the incoming touch events. More...
 
class  kanzi::PopupScope
 Implements the popup scopes. More...
 
class  kanzi::TextInputManipulator
 The text input manipulator handles key gestures used with TextBox nodes to move the cursor, select text, and delete text, and provides the basics of text editing capabilities in Kanzi. More...
 
class  kanzi::VisitorFunction
 Wraps a focus scope visitor function into a FocusScopeVisitor. More...
 

Enumerations

enum  kanzi::InputTranslation {
  kanzi::TranslateNone, kanzi::TranslatePointerToTouch, kanzi::TranslateTouchToPointer, kanzi::TranslatePointerToTouchPreserve,
  kanzi::TranslateTouchToPointerPreserve
}
 Enumeration to select translation of events. More...
 

Functions

FocusScopekanzi::findAncestorScopeForNode (const Node &node)
 Returns the ancestor focus scope of the node that you pass as an argument. More...
 
template<typename Predicate >
FocusScopekanzi::findAncestorScopeIf (Node &first, Node &last, Predicate predicate)
 Find the first ancestor scope in the [first node, last node) range, for which the predicate returns true. More...
 
template<typename Predicate >
FocusScopekanzi::findAncestorScopeIfNot (Node &first, Node &last, Predicate predicate)
 Find the first ancestor scope in the [first node, last node) range, for which the predicate returns false. More...
 
FocusFencekanzi::findFenceForNode (const Node &node)
 Returns the focus fence of the given node that you pass as an argument. More...
 
FocusScopekanzi::findScopeForNode (const Node &node)
 Returns the focus scope of the node that you pass as an argument. More...
 
template<typename Function >
void kanzi::forEachAncestorNodeInScope (const Node &node, const FocusScope *scope, Function function)
 Execute a function for every ancestor node of the node, until and including the focus scope node that is an ancestor of the node. More...
 
template<typename Function >
void kanzi::forEachAncestorScope (Node &first, Node &last, Function function)
 Execute a function for every focus scope in the [first node, last node) range. More...
 
template<typename Function >
void kanzi::forEachAncestorScopeOf (Node &node, Function function)
 Execute a function for every ancestor focus scope of the node, until and including the popup-type scope node that owns the node. More...
 
ModalScopekanzi::getPopupTypeScopeForNode (const Node &node)
 Returns the root node of a popup or modal focus scope to which the node that you pass in this method belongs. More...
 
Nodekanzi::getScopeFocusedNode (Node &node)
 Returns the last-focused node of the scope node. More...
 
template<typename TWrappedType >
shared_ptr< TWrappedType > kanzi::getWrappedEventSource (EventSourceSharedPtr eventSource)
 Returns the event source wrapper of TWrappedType type from the passed event source. More...
 
bool kanzi::isPopupTypeScope (const FocusScope *scope)
 Returns true if the focus scope passed as argument is a popup or modal focus scope. More...
 
bool kanzi::operator!= (const FocusChainIndex &lhs, const FocusChainIndex &rhs)
 Inequality operator overload for focus chain index. More...
 
bool kanzi::operator< (const FocusChainIndex &lhs, const FocusChainIndex &rhs)
 Less operator overload for focus chain index. More...
 
bool kanzi::operator<= (const FocusChainIndex &lhs, const FocusChainIndex &rhs)
 Less or equal operator overload for focus chain index. More...
 
bool kanzi::operator== (const FocusChainIndex &lhs, const FocusChainIndex &rhs)
 Equality operator overload for focus chain index. More...
 
bool kanzi::operator> (const FocusChainIndex &lhs, const FocusChainIndex &rhs)
 Greater operator overload for focus chain index. More...
 
bool kanzi::operator>= (const FocusChainIndex &lhs, const FocusChainIndex &rhs)
 Greater or equal operator overload for focus chain index. More...
 
void kanzi::setScopeFocusedNode (Node &scope, Node &node)
 Sets the focus node for the given scope node. More...
 
FocusChainNode kanzi::unwrapFocusChainNode (FocusScope::FocusChain::FocusedTuple wrapped)
 Unwraps the focus chain node representation of the focused node of a focus scope from a wrapped node. More...
 

Detailed Description

Input and focus handling.

Enumeration Type Documentation

◆ InputTranslation

Enumeration to select translation of events.

Enumerator
TranslateNone 

Do not translate anything, receive both touch and pointer events.

TranslatePointerToTouch 

Translate all pointer events to touch events. Disable pointer events.

TranslateTouchToPointer 

Translate all touch events to pointer events. Disable touch events.

TranslatePointerToTouchPreserve 

Translate all pointer events to touch events. Preserve pointer events.

TranslateTouchToPointerPreserve 

Translate all touch events to pointer events. Preserve pointer events.

Function Documentation

◆ getWrappedEventSource()

template<typename TWrappedType >
shared_ptr<TWrappedType> kanzi::getWrappedEventSource ( EventSourceSharedPtr  eventSource)

Returns the event source wrapper of TWrappedType type from the passed event source.

If the event source is not a valid TWrappedType, but it is wrapped in an EventSourceDecorator, the function continues to cross-cast the event source returned by the EventSourceDecorator::getEventSource(), until it finds a valid event source.

Template Parameters
TWrappedTypeThe wrapped event source type.
Parameters
eventSourceThe event source to cross-cast.
Returns
If an event source that casts to TWrappedType is found, returns that event source. If no event source that casts to TWrappedType is found, returns nullptr.
Since
Kanzi 3.9.0

◆ operator>()

bool kanzi::operator> ( const FocusChainIndex lhs,
const FocusChainIndex rhs 
)

Greater operator overload for focus chain index.

◆ operator<()

bool kanzi::operator< ( const FocusChainIndex lhs,
const FocusChainIndex rhs 
)

Less operator overload for focus chain index.

◆ operator>=()

bool kanzi::operator>= ( const FocusChainIndex lhs,
const FocusChainIndex rhs 
)

Greater or equal operator overload for focus chain index.

◆ operator<=()

bool kanzi::operator<= ( const FocusChainIndex lhs,
const FocusChainIndex rhs 
)

Less or equal operator overload for focus chain index.

◆ operator==()

bool kanzi::operator== ( const FocusChainIndex lhs,
const FocusChainIndex rhs 
)

Equality operator overload for focus chain index.

◆ operator!=()

bool kanzi::operator!= ( const FocusChainIndex lhs,
const FocusChainIndex rhs 
)

Inequality operator overload for focus chain index.

◆ unwrapFocusChainNode()

FocusChainNode kanzi::unwrapFocusChainNode ( FocusScope::FocusChain::FocusedTuple  wrapped)

Unwraps the focus chain node representation of the focused node of a focus scope from a wrapped node.

Parameters
wrappedThe tuple with the focus chain and the iterator that points to the focus chain node compacted.
Returns
The focus chain node unwrapped, or an invalid focus chain node if the tuple is invalid.
Since
Kanzi 3.9.0

◆ findScopeForNode()

FocusScope* kanzi::findScopeForNode ( const Node node)

Returns the focus scope of the node that you pass as an argument.

If that node is the focus scope node, returns the focus scope of the node itself.

Parameters
nodeThe node whose focus scope you want to get.
Returns
The focus scope of the requested node. If the node is not in a focus scope, returns nullptr.
Since
Kanzi 3.7.0

◆ findAncestorScopeForNode()

FocusScope* kanzi::findAncestorScopeForNode ( const Node node)

Returns the ancestor focus scope of the node that you pass as an argument.

Parameters
nodeThe node whose focus scope you want to get.
Returns
The focus scope of the requested node. If the node is not in a focus scope, returns nullptr.
Since
Kanzi 3.9.0

◆ findFenceForNode()

FocusFence* kanzi::findFenceForNode ( const Node node)

Returns the focus fence of the given node that you pass as an argument.

Parameters
nodeThe node whose focus fence node you want to get.
Returns
The focus fence of the requested node. If the node is not in a focus fence, returns a nullptr.
See also
FocusScopeTypeProperty
Since
Kanzi 3.7.0

◆ getPopupTypeScopeForNode()

ModalScope* kanzi::getPopupTypeScopeForNode ( const Node node)

Returns the root node of a popup or modal focus scope to which the node that you pass in this method belongs.

Parameters
nodeThe node for which you request the root node of a popup focus scope.
Returns
The popup focus scope. If one of the ancestor nodes is not attached, returns an invalid scope.
Since
Kanzi 3.7.0

◆ isPopupTypeScope()

bool kanzi::isPopupTypeScope ( const FocusScope scope)

Returns true if the focus scope passed as argument is a popup or modal focus scope.

Parameters
scopeThe focus scope to check.
Returns
If the scope is popup or modal focus scope, true. If the scope is not a popup or modal focus scope, or nullptr, false.
Since
Kanzi 3.7.0

◆ forEachAncestorScope()

template<typename Function >
void kanzi::forEachAncestorScope ( Node first,
Node last,
Function  function 
)

Execute a function for every focus scope in the [first node, last node) range.

Template Parameters
FunctionA function with a
{void(FocusScope&)}
signature.
Parameters
firstThe node which defines the first focus scope of the range.
lastThe node which must be the ancestor node, but not the scope node of the last focus scope of the range.
functionThe function to execute on each focus scope in the range.
Since
Kanzi 3.9.0

◆ forEachAncestorScopeOf()

template<typename Function >
void kanzi::forEachAncestorScopeOf ( Node node,
Function  function 
)

Execute a function for every ancestor focus scope of the node, until and including the popup-type scope node that owns the node.

Template Parameters
FunctionA function with a
{void(FocusScope&)}
signature.
Parameters
nodeThe node for whose focus scope you want to start the function execution.
functionThe function to execute on each focus scope.
Since
Kanzi 3.9.0

◆ forEachAncestorNodeInScope()

template<typename Function >
void kanzi::forEachAncestorNodeInScope ( const Node node,
const FocusScope scope,
Function  function 
)

Execute a function for every ancestor node of the node, until and including the focus scope node that is an ancestor of the node.

Template Parameters
FunctionA function with a
{void(Node&)}
signature.
Parameters
nodeThe node on which you want to start the function execution.
scopeThe scope that is the ancestor of the node.
functionThe function to execute on each ancestor node until the scope node.
Since
Kanzi 3.9.1

◆ findAncestorScopeIf()

template<typename Predicate >
FocusScope* kanzi::findAncestorScopeIf ( Node first,
Node last,
Predicate  predicate 
)

Find the first ancestor scope in the [first node, last node) range, for which the predicate returns true.

Template Parameters
PredicateA function with a
{bool(FocusScope&)}
signature.
Parameters
firstThe node which defines the first focus scope of the range.
lastThe node which must be the ancestor node, but not the scope node of the last focus scope of the range.
predicateThe function to execute on each focus scope.
Returns
The pointer to the focus scope for which the predicate returns true. If the predicate returns false, returns nullptr.
Since
Kanzi 3.9.0

◆ findAncestorScopeIfNot()

template<typename Predicate >
FocusScope* kanzi::findAncestorScopeIfNot ( Node first,
Node last,
Predicate  predicate 
)

Find the first ancestor scope in the [first node, last node) range, for which the predicate returns false.

Template Parameters
PredicateA function with a
{bool(FocusScope&)}
signature.
Parameters
firstThe node which defines the first focus scope of the range.
lastThe node which must be the ancestor node, but not the scope node of the last focus scope of the range.
predicateThe function to execute on each focus scope.
Returns
The pointer to the focus scope for which the predicate returns true. If the predicate returns false, returns nullptr.
Since
Kanzi 3.9.0

◆ getScopeFocusedNode()

Node* kanzi::getScopeFocusedNode ( Node node)

Returns the last-focused node of the scope node.

Parameters
nodeThe scope node for which to return the last-focused node.
Returns
The last-focused node of the focus scope. If the node is not a focus scope or it does not have a last-focused node or otherwise focused node, returns nullptr.
Since
Kanzi 3.9.0 The purpose of the function changed.

◆ setScopeFocusedNode()

void kanzi::setScopeFocusedNode ( Node scope,
Node node 
)

Sets the focus node for the given scope node.

Clears the last-focused node of the scope, and sets the last-focused node of the scope to the node.

Parameters
scopeThe scope to which the focus node is set.
nodeThe node which becomes the focus node of the scope.
Since
Kanzi 3.9.0 The purpose of the function changed.