PSHostRawUserInterface.ReadKey Method

Definition

Overloads

ReadKey()

Reads a key stroke from the keyboard device, blocking until a keystroke is typed. Same as ReadKey(ReadKeyOptions.IncludeKeyDown | ReadKeyOptions.IncludeKeyUp)

ReadKey(ReadKeyOptions)

Reads a key stroke from the keyboard device, blocking until a keystroke is typed. Either one of ReadKeyOptions.IncludeKeyDown and ReadKeyOptions.IncludeKeyUp or both must be specified.

ReadKey()

Reads a key stroke from the keyboard device, blocking until a keystroke is typed. Same as ReadKey(ReadKeyOptions.IncludeKeyDown | ReadKeyOptions.IncludeKeyUp)

public System.Management.Automation.Host.KeyInfo ReadKey ();
Returns

Key stroke when a key is pressed or released.

ReadKey(ReadKeyOptions)

Reads a key stroke from the keyboard device, blocking until a keystroke is typed. Either one of ReadKeyOptions.IncludeKeyDown and ReadKeyOptions.IncludeKeyUp or both must be specified.

public abstract System.Management.Automation.Host.KeyInfo ReadKey (System.Management.Automation.Host.ReadKeyOptions options);
Parameters
options
ReadKeyOptions

A bit mask of the options to be used to read the keyboard. Constants defined by ReadKeyOptions

Returns

Key stroke depending on the value of options.

Exceptions

Neither ReadKeyOptions.IncludeKeyDown nor ReadKeyOptions.IncludeKeyUp is specified.