Skip to content

InputAPI reference

Class TextInput

Namespace: MicroEngine.Input
Assembly: MicroEngine.Input.dll
Guide: Input

The text channel, separate from actions: while it is on, characters typed (and the text an input method is composing) arrive here instead of as keys to remember. Turn it on for name entry, chat or a console; on phones it shows the on-screen keyboard. A layer above gameplay (a text field) may take text events itself.

C#
public sealed class TextInput

Inheritance

object ← TextInput

Constructors

TextInput()

C#
public TextInput()

Properties

Active

Whether text input is on.

C#
public bool Active { get; }

Property Value

bool

Composition

The text an input method is composing and has not committed yet (empty when none).

C#
public string Composition { get; }

Property Value

string

Typed

The characters typed since the previous update, in order (empty while off). Backspace and Enter are keys, never text.

C#
public string Typed { get; }

Property Value

string

Methods

Start(RectF)

Turns text input on. caret is where the text being edited is, in virtual canvas pixels, so an input method can show its candidates next to it.

C#
public void Start(RectF caret = default)

Parameters

caret RectF

Stop()

Turns text input off and drops what was being composed.

C#
public void Stop()