Skip to content

InputActor

[Source]

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.

actor tag InputActor is
  InputListener tag,
  _HitTestRequester tag

Implements


Constructors

create

[Source]

new tag create(
  input: TerminalInput tag,
  compositor: Compositor tag)
: InputActor tag^

Parameters

Returns


Public Behaviours

register_focusable

[Source]

Add a widget to the focus list with an optional scope. The first registered widget in an enabled scope receives focus automatically.

be register_focusable(
  widget: Widget tag,
  scope: (Any tag | None val) = reference)

Parameters


register_widget

[Source]

Register a widget for resize notifications without adding to focus list.

be register_widget(
  widget: Widget tag)

Parameters


unregister_focusable

[Source]

Remove a widget from both the scope registry and the focus list, and adjust the focus index.

be unregister_focusable(
  widget: Widget tag)

Parameters


disable_scope

[Source]

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.

be disable_scope(
  scope: Any tag)

Parameters

  • scope: Any tag

enable_scope

[Source]

Re-enable a previously disabled scope, restoring its widgets to the active focus list. No-op if the scope is not currently disabled.

be enable_scope(
  scope: Any tag)

Parameters

  • scope: Any tag

receive

[Source]

Called by TerminalInput when raw bytes arrive. Parses and routes events.

be receive(
  data: Array[U8 val] val)

Parameters


hit_test_result

[Source]

Callback from compositor hit_test. Mouse routing is not yet implemented.

be hit_test_result(
  widget: (Any tag | None val))

Parameters