Skip to content
ConsoleMonster

API Reference

Class

InputEvent

Namespace ConsoleMonster.Input
Assembly ConsoleMonster
Modifiers sealed

One input event from any source (Windows console records, VT sequences, the PowerShell host, a script in tests), normalized so controls never care where it came from: printable characters have set, no Shift modifier, and derived from the character where one exists (letters, digits, space); Enter, Tab, Backspace and Escape carry their control character in ; Ctrl+letter has set to the letter, and no character; navigation and function keys have no character.

Inheritance

  • Object
  • InputEvent

Usage

Explore 16 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Accepted by parameters 5

Methods

public static InputEvent Character(Char character, KeyModifiers modifiers = None) #
Returns: InputEvent

Creates a typed character. Shift is dropped (the character reflects it); Alt and Control are kept.

Parameters

character System.Char requiredposition: 0
The character.
modifiers ConsoleMonster.Input.KeyModifiers = None optionalposition: 1
The modifiers.

Returns

The event.

public static InputEvent Focus(Boolean gained) #
Returns: InputEvent

Creates a focus notification.

Parameters

gained System.Boolean requiredposition: 0
Whether focus was gained (true) or lost.

Returns

The event.

public Boolean Is(ConsoleKey key, KeyModifiers modifiers = None) #
Returns: Boolean

Whether this is a press of key with exactly modifiers.

Parameters

key System.ConsoleKey requiredposition: 0
The key.
modifiers ConsoleMonster.Input.KeyModifiers = None optionalposition: 1
The modifiers.

Returns

True on a match.

public Boolean IsChar(Char character) #
Returns: Boolean

Whether this is the typed character character (no Ctrl or Alt).

Parameters

character System.Char requiredposition: 0
The character.

Returns

True on a match.

public static InputEvent Paste(String text) #
Returns: InputEvent

Creates a paste.

Parameters

text System.String requiredposition: 0
The pasted text.

Returns

The event.