Class Input
Input management tools
Inheritance
Namespace: Terminaux.Inputs
Assembly: Terminaux.dll
Syntax
public static class Input
Properties
| Edit this page View SourceDoubleClickTimeout
Specifies the time in milliseconds whether the double click times out
Declaration
public static TimeSpan DoubleClickTimeout { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
EnableMouse
Whether to enable mouse support.
Declaration
public static bool EnableMouse { get; set; }
Property Value
Type | Description |
---|---|
bool |
EnableMovementEvents
Checks to see whether the movement events are enabled or not
Declaration
public static bool EnableMovementEvents { get; set; }
Property Value
Type | Description |
---|---|
bool |
InputAvailable
Checks to see whether any pending mouse or keyboard events are here
Declaration
public static bool InputAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
InvertScrollYAxis
Whether to invert the Y axis for scrolling or not.
Declaration
public static bool InvertScrollYAxis { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
If this option is enabled, scrolling up emits the scroll down event, and scrolling down emits the scroll up event. Otherwise, scrolling up emits the scroll up event, and scrolling down emits the scroll down event.
KeyboardInputAvailable
Checks to see whether any pending keyboard events are here
Declaration
public static bool KeyboardInputAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
MouseInputAvailable
Checks to see whether any pending mouse events are here
Declaration
public static bool MouseInputAvailable { get; }
Property Value
Type | Description |
---|---|
bool |
PointerActive
Checks to see whether the pointer is active or not
Declaration
public static bool PointerActive { get; }
Property Value
Type | Description |
---|---|
bool |
SwapLeftRightButtons
Whether to invert the left and the right mouse buttons for left-handed people or not.
Declaration
public static bool SwapLeftRightButtons { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This is suitable for left-handed people (i.e. you use your mouse in your left hand). If this option is enabled, clicking on the left button of your mouse emits the right click event, and clicking on the right button of your mouse emits the left click event. Otherwise, clicking on the left button of your mouse emits the left click event, and clicking on the right button of your mouse emits the right click event.
Methods
| Edit this page View SourceInvalidateInput()
Invalidates the input
Declaration
public static void InvalidateInput()
ReadKey()
Reads the next key from the console input stream
Declaration
public static ConsoleKeyInfo ReadKey()
Returns
Type | Description |
---|---|
ConsoleKeyInfo |
ReadKey(bool)
Reads the next key from the console input stream
Declaration
public static ConsoleKeyInfo ReadKey(bool intercept)
Parameters
Type | Name | Description |
---|---|---|
bool | intercept | Whether to intercept the key pressed or to just show the actual key to the console |
Returns
Type | Description |
---|---|
ConsoleKeyInfo |
ReadKeyTimeout(bool, TimeSpan)
Reads the next key from the console input stream with the timeout
Declaration
public static (ConsoleKeyInfo result, bool provided) ReadKeyTimeout(bool Intercept, TimeSpan Timeout)
Parameters
Type | Name | Description |
---|---|---|
bool | Intercept | Whether to intercept an input |
TimeSpan | Timeout | Timeout |
Returns
Type | Description |
---|---|
(ConsoleKeyInfo result, bool provided) |
ReadPointer()
Reads a pointer (blocking)
Declaration
public static PointerEventContext? ReadPointer()
Returns
Type | Description |
---|---|
PointerEventContext | A PointerEventContext instance that describes the last mouse event. |
ReadPointerOrKey()
Reads either a pointer or a key (blocking)
Declaration
public static (PointerEventContext?, ConsoleKeyInfo) ReadPointerOrKey()
Returns
Type | Description |
---|---|
(PointerEventContext, ConsoleKeyInfo) |