API Reference
InputEvent
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.
Returned or exposed by 11
- Method ConsoleKeyInput.FromKeyInfo
- Method ConsoleKeyInput.Read
- Method IInputSource.Read
- Method InputEvent.Character
- Method InputEvent.Focus
- Method InputEvent.Paste
- Method InputEvent.Press
- Method InputEvent.Resized
- Method ScriptedInput.ParseEvents
- Method ScriptedInput.Read
- Method WindowsConsoleInput.Read
Accepted by parameters 5
- Method KeyChord.Matches
- Constructor ScriptedInput.ScriptedInput
- Method VtInputDecoder.Feed
- Method VtInputDecoder.Flush
- Method KeyBinding.Matches
Methods
public static InputEvent Character(Char character, KeyModifiers modifiers = None) #InputEventCreates a typed character. Shift is dropped (the character reflects it); Alt and Control are kept.
Parameters
- character System.Char
- The character.
- modifiers ConsoleMonster.Input.KeyModifiers = None
- The modifiers.
Returns
The event.
public static InputEvent Focus(Boolean gained) #InputEventCreates a focus notification.
Parameters
- gained System.Boolean
- Whether focus was gained (true) or lost.
Returns
The event.
public Boolean Is(ConsoleKey key, KeyModifiers modifiers = None) #BooleanWhether this is a press of key with exactly modifiers.
Parameters
- key System.ConsoleKey
- The key.
- modifiers ConsoleMonster.Input.KeyModifiers = None
- The modifiers.
Returns
True on a match.
public Boolean IsChar(Char character) #BooleanWhether this is the typed character character (no Ctrl or Alt).
Parameters
- character System.Char
- The character.
Returns
True on a match.
public static InputEvent Paste(String text) #InputEventCreates a paste.
Parameters
- text System.String
- The pasted text.
Returns
The event.