InputActor¶
Reads terminal input, parses events, routes to focused widget. Listens for SIGWINCH to detect terminal resize.
Focus is scope-aware: widgets are registered with an optional scope token. Disabling a scope removes its widgets from the active focus list. Widgets with no scope (None) are always active.
Implements¶
- InputListener tag
- _HitTestRequester tag
Constructors¶
create¶
Parameters¶
- input: TerminalInput tag
- compositor: Compositor tag
Returns¶
- InputActor tag^
Public Behaviours¶
register_focusable¶
Add a widget to the focus list with an optional scope. The first registered widget in an enabled scope receives focus automatically.
Parameters¶
register_widget¶
Register a widget for resize notifications without adding to focus list.
Parameters¶
- widget: Widget tag
unregister_focusable¶
Remove a widget from both the scope registry and the focus list, and adjust the focus index.
Parameters¶
- widget: Widget tag
disable_scope¶
Disable a scope, removing its widgets from the active focus list. If the currently focused widget is in the disabled scope, focus moves to the first remaining widget.
Parameters¶
- scope: Any tag
enable_scope¶
Re-enable a previously disabled scope, restoring its widgets to the active focus list. No-op if the scope is not currently disabled.
Parameters¶
- scope: Any tag
receive¶
Called by TerminalInput when raw bytes arrive. Parses and routes events.
Parameters¶
hit_test_result¶
Callback from compositor hit_test. Mouse routing is not yet implemented.