Skip to content
ConsoleMonster
Class

FocusManager

ConsoleMonster.Interactive

Namespace
ConsoleMonster.Interactive
Assembly
ConsoleMonster
Implements
IDisposable
Modifiers
sealed

Maintains one enabled input's focus in stable tab order, including explicit and mouse focus requests.

Inheritance

  • object
  • FocusManager

Constructors

public FocusManager(IWidget layout) #

Discovers inputs in declaration order and applies their tab-order overrides.

Parameters

layout ConsoleMonster.Layout.IWidget required
The stable input layout.

Methods

public void Dispose() #

Detaches explicit focus requests. The final focused state remains available for snapshots.

public void Focus(InputControl control) #

Focuses a control belonging to this manager, if enabled.

Parameters

control ConsoleMonster.Interactive.InputControl required
The target control.
public bool FocusAt(int column, int row) #

Focuses the enabled control at the zero-based frame coordinates.

Parameters

column int required
The frame column.
row int required
The frame row.

Returns

bool Whether a control was focused.
public void MoveNext() #

Moves to the next enabled control, wrapping at the end.

public void MovePrevious() #

Moves to the previous enabled control, wrapping at the beginning.

Properties

public IReadOnlyList<InputControl> Controls { get; } #

A stable copy of the controls in tab order.

public InputControl? Current { get; } #

The focused control, or null when every control is disabled.