InputLayerManager Class
Definition
Namespace: Brine2D.Input
Manages input layers and routes input to them in priority order. All layers are always invoked each frame; the consumed flag is forwarded so lower-priority layers can perform cleanup even when input was already claimed.
Inheritance System.Object → InputLayerManager
Implements System.IDisposable
Remarks
Thread-safe: layer registration and processing are guarded by Brine2D.Input.InputLayerManager._lock. The lock is never held while invoking layer callbacks to avoid deadlocks when user handlers call RegisterLayer\(IInputLayer\) or UnregisterLayer\(IInputLayer\) re-entrantly.
| Properties | |
|---|---|
| GamepadConsumed | Returns true if gamepad input was consumed by any layer this frame. |
| KeyboardConsumed | Returns true if keyboard input was consumed by any layer this frame. |
| MouseConsumed | Returns true if mouse input was consumed by any layer this frame. |
| Methods | |
|---|---|
| ProcessInput() | Processes input through all layers in priority order. Call this once per frame after Update(). If a layer throws, the exception is logged and processing continues with the remaining layers so that a single misbehaving layer cannot break input for the entire frame. |
| RegisterLayer\(IInputLayer\) | Registers an input layer. |
| UnregisterLayer\(IInputLayer\) | Unregisters an input layer. |