8 instantiations of ConsoleKeyInfo
System.Console (8)
System\IO\KeyParser.cs (5)
27
return new
ConsoleKeyInfo
(buffer[startIndex++], ConsoleKey.Backspace, false, false, false);
36
return new
ConsoleKeyInfo
(parsed.KeyChar, parsed.Key, (parsed.Modifiers & ConsoleModifiers.Shift) != 0, alt: true, (parsed.Modifiers & ConsoleModifiers.Control) != 0);
109
parsed = new
ConsoleKeyInfo
(default, ConsoleKey.F1 + input[3] - 'A', false, false, false);
310
=>
new
(keyChar, key, (modifiers & ConsoleModifiers.Shift) != 0, (modifiers & ConsoleModifiers.Alt) != 0, (modifiers & ConsoleModifiers.Control) != 0);
353
return new
ConsoleKeyInfo
(keyChar, key, isShift, isAlt, isCtrl);
System\IO\StdInReader.cs (1)
359
return new
ConsoleKeyInfo
((char)
System\TerminalFormatStrings.cs (2)
233
KeyFormatToConsoleKey[keyFormat] = new
ConsoleKeyInfo
(key == ConsoleKey.Enter ? '\r' : '\0', key, shift, alt, control);
252
KeyFormatToConsoleKey[keyFormat] = new
ConsoleKeyInfo
('\0', key, shift, alt, control);
35 references to ConsoleKeyInfo
dotnet-svcutil-lib (2)
CmdCredentialsProvider.cs (2)
255
ConsoleKeyInfo
keyInfo;
275
ConsoleKeyInfo
keyInfo;
mscorlib (1)
src\libraries\shims\mscorlib\ref\mscorlib.cs (1)
132
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.
ConsoleKeyInfo
))]
netstandard (1)
netstandard.cs (1)
436
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.
ConsoleKeyInfo
))]
QueueSharing (1)
Program.cs (1)
21
var
key = Console.ReadKey();
System.Console (30)
System\Console.cs (2)
173
public static
ConsoleKeyInfo
ReadKey()
182
public static
ConsoleKeyInfo
ReadKey(bool intercept)
System\ConsoleKeyInfo.cs (7)
8
public readonly struct ConsoleKeyInfo : IEquatable<
ConsoleKeyInfo
>
53
return value is
ConsoleKeyInfo
info && Equals(info);
56
public bool Equals(
ConsoleKeyInfo
obj)
61
public static bool operator ==(
ConsoleKeyInfo
a,
ConsoleKeyInfo
b)
66
public static bool operator !=(
ConsoleKeyInfo
a,
ConsoleKeyInfo
b)
System\ConsolePal.Unix.cs (2)
122
public static
ConsoleKeyInfo
ReadKey(bool intercept)
131
ConsoleKeyInfo
keyInfo = StdInReader.ReadKey(intercept);
System\IO\KeyParser.cs (7)
18
internal static
ConsoleKeyInfo
Parse(char[] buffer, TerminalFormatStrings terminalFormatStrings, byte posixDisableValue, byte veraseCharacter, ref int startIndex, int endIndex)
34
if (TryParseTerminalInputSequence(buffer, terminalFormatStrings, out
ConsoleKeyInfo
parsed, ref startIndex, endIndex))
40
else if (length >= MinimalSequenceLength && TryParseTerminalInputSequence(buffer, terminalFormatStrings, out
ConsoleKeyInfo
parsed, ref startIndex, endIndex))
54
private static bool TryParseTerminalInputSequence(char[] buffer, TerminalFormatStrings terminalFormatStrings, out
ConsoleKeyInfo
parsed, ref int startIndex, int endIndex)
65
Dictionary<string,
ConsoleKeyInfo
>.AlternateLookup<ReadOnlySpan<char>> terminfoDb = // the most important source of truth
309
static
ConsoleKeyInfo
Create(char keyChar, ConsoleKey key, ConsoleModifiers modifiers)
313
private static
ConsoleKeyInfo
ParseFromSingleChar(char single, bool isAlt)
System\IO\StdInReader.cs (9)
23
private readonly Stack<
ConsoleKeyInfo
> _tmpKeys = new Stack<
ConsoleKeyInfo
>(); // temporary working stack; should be empty outside of ReadLine
24
private readonly Stack<
ConsoleKeyInfo
> _availableKeys = new Stack<
ConsoleKeyInfo
>(); // a queue of already processed key infos available for reading
167
ConsoleKeyInfo
keyInfo = freshKeys ? ReadKey() : _availableKeys.Pop();
293
ConsoleKeyInfo
keyInfo = peek ? _availableKeys.Peek() : _availableKeys.Pop();
321
public
ConsoleKeyInfo
ReadKey(bool intercept)
328
ConsoleKeyInfo
keyInfo = ReadKey();
338
private unsafe
ConsoleKeyInfo
ReadKey()
System\IO\SyncTextReader.Unix.cs (1)
23
public
ConsoleKeyInfo
ReadKey(bool intercept)
System\TerminalFormatStrings.cs (2)
54
public readonly Dictionary<string,
ConsoleKeyInfo
> KeyFormatToConsoleKey = new(StringComparer.Ordinal);
166
foreach (KeyValuePair<string,
ConsoleKeyInfo
> entry in KeyFormatToConsoleKey)