Kanzi  3.9.4
Kanzi Engine API
Input and Focus

Input and focus handling. More...

Collaboration diagram for Input and Focus:

Classes

class  kanzi::AutoClosingModalScope
 Implements the auto-closing modal scopes. More...
 
class  kanzi::AutoClosingModelessScope
 Implements the auto-closing modeless focus scope. More...
 
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::ModelessScope
 Implements the modeless overlay focus 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::OverlayScope
 Implements the base of overlay focus scopes. 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::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...
 

Typedefs

using kanzi::PopupScope = AutoClosingModalScope
 Implements the popup scopes. 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...
 
template<typename Function >
OverlayScopekanzi::findInputPropagationOverlayIf (OverlayScope *overlayScope, Function predicate)
 Finds the overlay focus scope that is the overlayScope, or one of its preceding overlay focus scopes to which Kanzi lets the input propagate, for which the predicate function returns true. More...
 
OverlayScopekanzi::findOverlayScopeForNode (const Node &node)
 Returns the overlay focus scope to which the node that you pass in this function belongs. 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)
 Executes a function for every ancestor focus scope of the node, until and including the overlay focus scope node that owns the node. 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::isNodeInFocusableOverlay (const Node &node)
 Returns whether the given node is in one of the overlay scopes that are on top of the foremost modal scope, or in that modal scope itself. More...
 
bool kanzi::isOverlayFocusable (const OverlayScope &overlay)
 Returns whether the given overlay is focusable. More...
 
bool kanzi::isOverlayScope (const FocusScope *scope)
 Returns whether the focus scope passed as argument is an overlay 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.

Typedef Documentation

◆ PopupScope

Implements the popup scopes.

Since
Kanzi 3.7.0
Deprecated:
In Kanzi 3.9.2

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

◆ findOverlayScopeForNode()

OverlayScope* kanzi::findOverlayScopeForNode ( const Node node)

Returns the overlay focus scope to which the node that you pass in this function belongs.

Parameters
nodeThe node for which to find the overlay focus scope.
Returns
The overlay focus scope. If one of the ancestor nodes is not attached, returns an invalid scope.
Since
Kanzi 3.9.2

◆ isOverlayScope()

bool kanzi::isOverlayScope ( const FocusScope scope)

Returns whether the focus scope passed as argument is an overlay focus scope.

Parameters
scopeThe focus scope to check.
Returns
If the scope is an overlay focus scope, true. otherwise false.
Since
Kanzi 3.9.2

◆ isNodeInFocusableOverlay()

bool kanzi::isNodeInFocusableOverlay ( const Node node)

Returns whether the given node is in one of the overlay scopes that are on top of the foremost modal scope, or in that modal scope itself.

Since
Kanzi 3.9.2

◆ isOverlayFocusable()

bool kanzi::isOverlayFocusable ( const OverlayScope overlay)

Returns whether the given overlay is focusable.

An overlay is focusable if it is the foremost modal overlay or a modeless overlay above the foremost modal overlay in the overlay stack.

Returns
If the given overlay is focusable, true, otherwise false.
Since
Kanzi 3.9.3

◆ 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 
)

Executes a function for every ancestor focus scope of the node, until and including the overlay focus 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 false. If the predicate returns true, returns nullptr.
Since
Kanzi 3.9.0

◆ findInputPropagationOverlayIf()

template<typename Function >
OverlayScope* kanzi::findInputPropagationOverlayIf ( OverlayScope overlayScope,
Function  predicate 
)

Finds the overlay focus scope that is the overlayScope, or one of its preceding overlay focus scopes to which Kanzi lets the input propagate, for which the predicate function returns true.

Template Parameters
FunctionA function with a
{bool(OverlayScope&)}
signature.
Parameters
overlayScopeThe overlay focus scope on which you want to start the function execution.
predicateThe function to execute on each overlay focus scope.
Returns
The pointer to the overlay focus scope for which the predicate returns true. If the predicate returns false for all preceding overlay focus scopes, returns nullptr.
Since
Kanzi 3.9.2

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