Kanzi Engine API
kanzi::InputManager Class Reference

InputManager converts the events from the given event queue into input specific messages. More...

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

Public Member Functions

KZ_DEPRECATED NodeSharedPtr getFocus () const
 Gets currently focused node. More...
 
FocusManagergetFocusManager () const
 Returns the instance of the focus manager. More...
 
 InputManager (Domain *domain)
 Create an input manager. More...
 
void notifyNodeDetached (Node &node)
 Node notifies the input manager that Kanzi is detaching it from the node tree. More...
 
void processEvents (EventQueue &queue)
 Processes a queue of input events. More...
 
void resetInput ()
 Resets the InputManager canceling the ongoing gesture recognitions and cleaning up the input manipulators. More...
 
KZ_DEPRECATED NodeSharedPtr setFocus (NodeSharedPtr newFocusNode)
 Attempts to set focus to a node. More...
 
bool setInputManipulatorState (InputManipulator &inputManipulator, InputManipulator::State state)
 Sets the state of an inputManipulator and, based on that state, synchronizes the input manipulators registered to the Input Manager. More...
 
virtual ~InputManager ()
 

Friends

class InputManipulator
 
class KeyManipulator
 

Detailed Description

InputManager converts the events from the given event queue into input specific messages.

The events supported are key, touch, and mouse pointer events. The key events are forwarded to key manipulators, and the touch and pointer events are unified into press, change and release messages, and forwarded to InputManipulators, which in turn handles the input and dispatch those through proprietary messages. The input manipulators are gathered automatically from the node or its children passed as argument to the processEvents() method.

See also
KeyManipulator, InputManipulator

Constructor & Destructor Documentation

kanzi::InputManager::InputManager ( Domain domain)
explicit

Create an input manager.

Parameters
domainThe domain that owns the input manager.
virtual kanzi::InputManager::~InputManager ( )
virtual

Member Function Documentation

FocusManager* kanzi::InputManager::getFocusManager ( ) const

Returns the instance of the focus manager.

Returns
Instance of the focus manager.
void kanzi::InputManager::processEvents ( EventQueue queue)

Processes a queue of input events.

Parameters
queueEvent queue that holds events that are processed.
bool kanzi::InputManager::setInputManipulatorState ( InputManipulator inputManipulator,
InputManipulator::State  state 
)

Sets the state of an inputManipulator and, based on that state, synchronizes the input manipulators registered to the Input Manager.

Do not call this method from the InputManipulator::notifyTouchInside(), InputManipulator::notifyTouchOutside() or InputManipulator::notifyKeyInput() method.

Parameters
inputManipulatorThe input manipulator whose state to set.
stateThe state to which to set the input manipulator.
Returns
If setting the state succeeds, returns true, otherwise false.
Since
Kanzi 3.9.0
KZ_DEPRECATED NodeSharedPtr kanzi::InputManager::setFocus ( NodeSharedPtr  newFocusNode)

Attempts to set focus to a node.

Deprecated:
In Kanzi 3.6.3. Use FocusManager::trySetFocus() instead.
KZ_DEPRECATED NodeSharedPtr kanzi::InputManager::getFocus ( ) const

Gets currently focused node.

Deprecated:
In Kanzi 3.6.3. Use FocusManager::getFocus() instead.
void kanzi::InputManager::resetInput ( )

Resets the InputManager canceling the ongoing gesture recognitions and cleaning up the input manipulators.

void kanzi::InputManager::notifyNodeDetached ( Node node)

Node notifies the input manager that Kanzi is detaching it from the node tree.

Parameters
nodeThe node which is detached.

Friends And Related Function Documentation

friend class InputManipulator
friend
friend class KeyManipulator
friend

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