I am trying to run my code until Esc was pressed. Therefore I am using ReadKey
in my Console
var input = Console.ReadKey();
do
{
} while (input.Key != ConsoleKey.Escape);
but at "ConsoleKey" it says that, ConsoleKey isn't possible in 'bool'. How can I fix that? Or what shall I use instead?
Try this:
ConsoleKeyInfo input;
do
{
input = Console.ReadKey();
} while (input.Key != ConsoleKey.Escape);