public static void Main(String[] args)
{
bool tag = true;
do
{
ConsoleKeyInfo info = Console.ReadKey();
switch (info.Key)
{
case ConsoleKey.E:
Console.WriteLine("exit");
tag = false;
break;
case ConsoleKey.UpArrow:
Console.WriteLine("Up");
break;
case ConsoleKey.DownArrow:
Console.WriteLine("Down");
break;
case ConsoleKey.LeftArrow:
Console.WriteLine("Left");
break;
case ConsoleKey.RightArrow:
Console.WriteLine("Right");
break;
default:
Console.WriteLine(info.Key);
break;
}
} while (tag);
Console.Read();
}