Is there a way to start a method in C# if a key is pressed? For example, Esc?
In case someone is looking for how to do this in a console application
if (Console.ReadKey().Key == ConsoleKey.Escape) { return; }