Console.ReadKey()
returning an empty ConsoleKeyInfo.Key
for most keys.
#107157
Labels
Console.ReadKey()
returning an empty ConsoleKeyInfo.Key
for most keys.
#107157
Description
When using
Console.ReadKey(true)
and attempting to read the values in the returnedConsoleKeyInfo
, theKey
is empty for most keys, specifically any keys notOem
prefixed, not in the numpad, or theLeftWindows
key (as far as my testing has gone). This is despiteKeyChar
always containing the correct key.Reproduction Steps
This code should suffice with a breakpoint to check the output:
ConsoleKeyInfo Key = Console.ReadKey(true);
.Expected behavior
ConsoleKeyInfo.Key
should contain values specified in theConsoleKey
enum corresponding to their keys.Actual behavior
ConsoleKeyInfo.Key
contains the value 0 orNone
.Regression?
No response
Known Workarounds
No response
Configuration
Using
net9.0-windows10.0.22621.0
, targeting platformx64
.Other information
No response
The text was updated successfully, but these errors were encountered: