Listen on ESC while reading Console line
问题 I want to read an users input into a string while still reacting on ESC press at any time, but without defining a system wide hotkey. So when the user types e. g. "Test Name" but instead of confirming with ENTER presses ESC he should be led back into main menu. Console.Write("Enter name: ") if (Console.ReadLine().Contains(ConsoleKey.Escape.ToString())) { goto MainMenu; } return Console.ReadLine(); Thats the simplest way I could think of, but since ESC is not seen by Console.ReadLine() it is