class Program { static void Main(string[] args) { int a; ConsoleKeyInfo keypress = Console.ReadKey(); if (keypress.Key == ConsoleKey.Escape) { Console.WriteLine("You are pressed Escape"); } a = keypress.KeyChar; if (a == 13) { Console.WriteLine("You are pressed Enter"); } keypress = Console.ReadKey(); if (keypress.Key == ConsoleKey.X && keypress.Modifiers == ConsoleModifiers.Control) { Console.WriteLine("You are pressed CTRL+X"); } Console.Read(); }
No comments:
Post a Comment