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 | |
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... | |
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... | |
void | updateEffectivelyEnabledState (Node &root) |
Node tells the Input Manager to update the Node::EffectivelyEnabledProperty for a root node and its descendant nodes in the same popup-type scope. More... | |
void | updateHoverStates (const PointerEvent &pointerEvent, Node2D *node) |
Processes pointer events to update hover states of the nodes in a subtree of the passed node. More... | |
~InputManager () | |
Destructor. More... | |
Gesture processing input manipulator collection methods | |
void | attachInputManipulator (InputManipulator *manipulator) |
Adds an input manipulator to the collection of gesture processing input manipulators. More... | |
void | detachInputManipulator (InputManipulator &manipulator) |
Removes an input manipulator from the collection of gesture processing input manipulators. More... | |
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.
|
explicit |
Create an input manager.
domain | The domain that owns the input manager. |
kanzi::InputManager::~InputManager | ( | ) |
Destructor.
void kanzi::InputManager::processEvents | ( | EventQueue & | queue | ) |
Processes a queue of input events.
queue | Event 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.
inputManipulator | The input manipulator whose state to set. |
state | The state to which to set the input manipulator. |
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.
node | The node which is detached. |
void kanzi::InputManager::updateEffectivelyEnabledState | ( | Node & | root | ) |
Node tells the Input Manager to update the Node::EffectivelyEnabledProperty for a root node and its descendant nodes in the same popup-type scope.
When a node gets effectively disabled, Input Manager resets all input manipulators for that node.
root | The root node of the subtree in which the Kanzi updates the values of the Node::EffectivelyEnabledProperty. |
void kanzi::InputManager::attachInputManipulator | ( | InputManipulator * | manipulator | ) |
Adds an input manipulator to the collection of gesture processing input manipulators.
manipulator | The input manipulator to add to the gesture processing collection. |
void kanzi::InputManager::detachInputManipulator | ( | InputManipulator & | manipulator | ) |
Removes an input manipulator from the collection of gesture processing input manipulators.
manipulator | The input manipulator to remove from the gesture processing collection. |
void kanzi::InputManager::updateHoverStates | ( | const PointerEvent & | pointerEvent, |
Node2D * | node | ||
) |
Processes pointer events to update hover states of the nodes in a subtree of the passed node.
pointerEvent | Pointer event to process. |
node | The node where the hit testing starts. |