Class Input
Input management tools
Inheritance
Namespace
Syntax
public static class Input
Properties
BassBoomLibraryPath
Root path to BassBoom's library path
Property Value
Declaration
public static string BassBoomLibraryPath { get; set; }
CueEnter
A stream for the submission key press keyboard cue
Property Value
Declaration
public static Stream CueEnter { get; set; }
CueRubout
A stream for the backspace key press keyboard cue
Property Value
Declaration
public static Stream CueRubout { get; set; }
CueVolume
Keyboard cue volume
Property Value
Declaration
public static double CueVolume { get; set; }
CueVolumeBoost
Whether to boost cue volume up to 3.0 or not
Property Value
Declaration
public static bool CueVolumeBoost { get; set; }
CueWrite
A stream for the key press keyboard cue
Property Value
Declaration
public static Stream CueWrite { get; set; }
DefaultLockCondition
Function that evaluates the final boolean. True means to stop waiting and to allow input to go through.
Property Value
Declaration
public static Func<bool> DefaultLockCondition { get; set; }
DoubleClickTimeout
Specifies the time in milliseconds whether the double click times out
Property Value
Declaration
public static TimeSpan DoubleClickTimeout { get; set; }
EnableMouse
Whether to enable mouse support.
Property Value
Declaration
public static bool EnableMouse { get; set; }
EnableMovementEvents
Checks to see whether the movement events are enabled or not
Property Value
Declaration
public static bool EnableMovementEvents { get; set; }
InvertScrollYAxis
Whether to invert the Y axis for scrolling or not.
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.
Property Value
Declaration
public static bool InvertScrollYAxis { get; set; }
KeyboardCues
Play keyboard cues for each keypress (a global switch)
Property Value
Declaration
public static bool KeyboardCues { get; set; }
PasswordMaskChar
Password mask character
Property Value
Declaration
public static char PasswordMaskChar { get; set; }
PointerActive
Checks to see whether the pointer is active or not
Property Value
Declaration
public static bool PointerActive { get; }
PointerEncoding
Selects a pointer encoding to use when receiving a raw mouse event
Remarks
While the SGR encoding provides extended position attributes, X10 is more compatible but limited.
Property Value
Declaration
public static PointerEncoding PointerEncoding { get; set; }
SwapLeftRightButtons
Whether to invert the left and the right mouse buttons for left-handed people or not.
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.
Property Value
Declaration
public static bool SwapLeftRightButtons { get; set; }
Methods
InvalidateInput()
Invalidates the input
Declaration
public static void InvalidateInput()
ReadKey(Func<bool>?, bool)
Reads the next key from the console input stream
Returns
Declaration
public static ConsoleKeyInfo ReadKey(Func<bool>? lockCondition = null, bool disableLock = false)
Parameters
| Name | Type | Description |
|---|---|---|
| lockCondition | Func<bool> | Function that evaluates the final boolean. True means to bail. |
| disableLock | bool | Allow input to go through without waiting for the lock function to evaluate to true |
ReadKeyTimeout(TimeSpan, Func<bool>?, bool)
Reads the next key from the console input stream with the timeout
Returns
Declaration
public static (ConsoleKeyInfo result, bool provided) ReadKeyTimeout(TimeSpan Timeout, Func<bool>? lockCondition = null, bool disableLock = false)
Parameters
| Name | Type | Description |
|---|---|---|
| Timeout | TimeSpan | Timeout |
| lockCondition | Func<bool> | Function that evaluates the final boolean. True means to bail. |
| disableLock | bool | Allow input to go through without waiting for the lock function to evaluate to true |
ReadPointerOrKey(InputEventType, Func<bool>?, bool)
Reads either a pointer or a key (blocking)
Returns
Declaration
public static InputEventInfo ReadPointerOrKey(InputEventType eventType = InputEventType.Mouse | InputEventType.Keyboard, Func<bool>? lockCondition = null, bool disableLock = false)
Parameters
| Name | Type | Description |
|---|---|---|
| eventType | InputEventType | Event types to wait for (None implies all events) |
| lockCondition | Func<bool> | Function that evaluates the final boolean. True means to stop waiting and to allow input to go through. |
| disableLock | bool | Allow input to go through without waiting for the lock function to evaluate to true |
ReadPointerOrKeyNoBlock(InputEventType)
Reads either a pointer or a key (non-blocking)
Returns
Declaration
public static InputEventInfo ReadPointerOrKeyNoBlock(InputEventType eventType = InputEventType.Mouse | InputEventType.Keyboard)
Parameters
| Name | Type | Description |
|---|---|---|
| eventType | InputEventType | Event types to wait for (None implies all events) |
ReadPointerOrKeyUntil(TimeSpan, InputEventType, Func<bool>?, bool)
Reads either a pointer or a key (blocking, supports timeout)
Returns
Declaration
public static (InputEventInfo result, bool provided) ReadPointerOrKeyUntil(TimeSpan timeout, InputEventType eventType = InputEventType.Mouse | InputEventType.Keyboard, Func<bool>? lockCondition = null, bool disableLock = false)
Parameters
| Name | Type | Description |
|---|---|---|
| timeout | TimeSpan | Timeout in milliseconds |
| eventType | InputEventType | Event types to wait for (None implies all events) |
| lockCondition | Func<bool> | Function that evaluates the final boolean. True means to bail. |
| disableLock | bool | Allow input to go through without waiting for the lock function to evaluate to true |