InputDispatcher class Input
Central dispatcher for input events.
The InputDispatcher
manages a list of InputHandlers and forwards
input events to them sequentially until one handles the event.
It coordinates with RenderManager to mark components dirty and request redraws when necessary, based on the handlers' responses.
Responsibilities:
- Register and unregister input handlers.
- Dispatch input events to handlers in order.
- Manage render invalidation for updated components.
- Return
true
if any handler signals an exit command.
Lifecycle:
- Created with a RenderManager instance.
- Handlers can be added or removed dynamically.
- Should be used as the single entry point for input events.
See also
- InputHandler: The interface for input event handlers.
- RenderManager: Manages rendering and redraw requests based on input.
- ResponseInput: Represents handler response including commands and dirty components.
- InputManager: The Class that manages all raw byte stream from stdin
Constructors
- InputDispatcher.new({required RenderManager renderer})
- Creates an input dispatcher with the given render manager.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispatchEvent(
InputEvent event) → bool - Dispatches an InputEvent to all registered handlers sequentially.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerHandler(
InputHandler handler) → void - Registers an InputHandler to receive dispatched input events.
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterHandler(
InputHandler handler) → void - Unregisters an InputHandler, so it no longer receives events.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited