InputEvent
ConsoleMonster.Input
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 34 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 12
- Method IInputSource.Read
- Method InputEvent.Character
- Method InputEvent.Focus
- Method InputEvent.Mouse
- Method InputEvent.Paste
- Method InputEvent.Pointer
- Method InputEvent.Press
- Method InputEvent.Resized
- Method InputEvent.WithPosition
- Method ScriptedInput.ParseEvents
- Method ScriptedInput.Read
- Property ConsoleAppOptions.HandleInput
Accepted by parameters 22
- Method HeadlessTerminal.Send
- Method KeyChord.Matches
- Constructor ScriptedInput.ScriptedInput
- Method Breadcrumb.HandleInput
- Method Button.HandleInput
- Method ChartView.HandleInput
- Method Collapsible.HandleInput
- Extension method ConsoleAppOptions.InterceptInput
- Method ConsoleAppOptionsFluent.InterceptInput
- Method DataGrid.HandleInput
- Method DatePicker.HandleInput
- Method InputControl.HandleInput
- Method KeyBinding.Matches
- Method LogViewport.HandleInput
- Method Outline.HandleInput
- Method Select.HandleInput
- Method SelectionInputBase.HandleInput
- Method TextInput.HandleInput
- Method Toggle.HandleInput
- Method TreeSelect.HandleInput
- Method LogTailView.Navigate
- Method Diagram.HandleInput
Methods
public static InputEvent Character(char character, KeyModifiers modifiers = None) #Creates a typed character. Shift is dropped (the character reflects it); Alt and Control are kept.
Parameters
- character char
- The character.
- modifiers ConsoleMonster.Input.KeyModifiers = None
- The modifiers.
public static InputEvent Focus(bool gained) #Creates a focus notification.
Parameters
- gained bool
- Whether focus was gained (true) or lost.
public bool Is(ConsoleKey key, KeyModifiers modifiers = None) #Whether this is a press of key with exactly modifiers.
Parameters
- key System.ConsoleKey
- The key.
- modifiers ConsoleMonster.Input.KeyModifiers = None
- The modifiers.
Returns
bool True on a match.public bool IsChar(char character) #Whether this is the typed character character (no Ctrl or Alt).
Parameters
- character char
- The character.
Returns
bool True on a match.public static InputEvent Mouse(int column, int row, int button = 1, bool pressed = true, KeyModifiers modifiers = None) #Creates a mouse button press or release at a character-cell position, retaining all modifiers.
Parameters
- column int
- The zero-based column.
- row int
- The zero-based row.
- button int = 1
- The button: 1 for left, 2 for middle, or 3 for right.
- pressed bool = true
- True for a press; false for a release.
- modifiers ConsoleMonster.Input.KeyModifiers = None
- The modifiers held when the button changed.
Exceptions
ArgumentOutOfRangeException– A coordinate is negative or the button is not supported.
public static InputEvent Pointer(int column, int row, MouseAction action, int button = 0, int wheelDelta = 0, int horizontalWheelDelta = 0, int heldButtons = 0, KeyModifiers modifiers = None) #Creates a normalized pointer event. Motion/wheel events use button zero when no button changed.
Parameters
- column int
- row int
- action ConsoleMonster.Input.MouseAction
- button int = 0
- wheelDelta int = 0
- horizontalWheelDelta int = 0
- heldButtons int = 0
- modifiers ConsoleMonster.Input.KeyModifiers = None
Returns
InputEvent