Table of Contents

Struct InputEvent

Namespace
Retro.Crt.Input
Assembly
Retro.Crt.dll

Tagged-union input event: read Kind first, then access the slot the discriminator names. Key and mouse events are zero-allocation; paste events carry a string for the pasted contents and so allocate one reference per event.

public readonly struct InputEvent
Inherited Members

Constructors

InputEvent(KeyEvent)

public InputEvent(KeyEvent key)

Parameters

key KeyEvent

InputEvent(MouseEvent)

public InputEvent(MouseEvent mouse)

Parameters

mouse MouseEvent

InputEvent(string)

public InputEvent(string paste)

Parameters

paste string

Properties

Key

public KeyEvent Key { get; }

Property Value

KeyEvent

Kind

public InputEventKind Kind { get; }

Property Value

InputEventKind

Mouse

public MouseEvent Mouse { get; }

Property Value

MouseEvent

Paste

The pasted text when Kind is Paste; otherwise null.

public string? Paste { get; }

Property Value

string