InputRegistry class Input

Maintains a global registry of InputHandler instances.

This class acts as a centralized registry where input handlers can be registered or unregistered to participate in input event processing.

Users can extend this registry to include their own custom input handlers, enabling modular and extensible input handling in an application.

Registered handlers can be accessed by input dispatchers or managers to process input events in sequence.

Example

class CustomInputHandler implements InputHandler {
  @override
  ResponseInput handleInput(InputEvent event) {
    // Custom input handling logic here.
    return ResponseInput.ignored();
  }
}

// Register your handler globally
InputRegistry.register(CustomInputHandler());

See Also

Constructors

InputRegistry.new()

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

handlers List<InputHandler>
Returns an unmodifiable list of all currently registered input handlers.
no setter

Static Methods

register(InputHandler handler) → void
Registers an InputHandler if not already registered.
unregister(InputHandler handler) → void
Unregisters a previously registered InputHandler.