Skip to content

Class TextInput

One line of editable text. Enter runs DarkEffekt.Terminal.UI.TextInput.OnSubmit.

Declaration
public sealed class TextInput : Element

Inheritance: System.Object -> DarkEffekt.Terminal.UI.Element

Declaration
public string Text { get; set; }

Shown dimmed while the input is empty.

Declaration
public string Placeholder { get; set; }
Declaration
public Action<string> OnSubmit { get; set; }
Declaration
public Action<string> OnChanged { get; set; }

True for an element that takes keyboard focus.

Declaration
public override bool Focusable { get; }

The size this element wants, within the room given.

Declaration
protected override CellSize MeasureCore(CellSize available)

DarkEffekt.Terminal.UI.CellSize

Type Name
DarkEffekt.Terminal.UI.CellSize available
Declaration
protected override void RenderCore(CellCanvas canvas)
Type Name
DarkEffekt.Terminal.UI.CellCanvas canvas

A key for this element. Return true when it was used; false passes it to the parent.

Declaration
public override bool OnKey(in TermKeyEvent e)

System.Boolean

Type Name
DarkEffekt.Terminal.TermKeyEvent e

A typed character for this element. Return true when it was used.

Declaration
public override bool OnChar(char c, TermModifiers modifiers)

System.Boolean

Type Name
System.Char c
DarkEffekt.Terminal.TermModifiers modifiers
Declaration
public override void OnPaste(string text)
Type Name
System.String text

A pointer event on this element. Return true when it was used.

Declaration
public override bool OnMouse(in TermMouseEvent e)

System.Boolean

Type Name
DarkEffekt.Terminal.TermMouseEvent e