Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- ConsoleKeyInfo cki;
- Console.TreatControlCAsInput = true;
- Console.WriteLine("Press Shift+S for more informations");
- do
- {
- cki = Console.ReadKey();
- Console.Write(" --- You pressed ");
- if ((cki.Modifiers & ConsoleModifiers.Shift) != 0) Console.Write("SHIFT+ ");
- Console.WriteLine(cki.Key.ToString());
- if (((cki.Modifiers & ConsoleModifiers.Shift) != 0) & (cki.Key == ConsoleKey.S)) Console.WriteLine(" Press T in order to get the key sequence to close the console");
- if (((cki.Modifiers & ConsoleModifiers.Alt) == 0) & ((cki.Modifiers & ConsoleModifiers.Control) == 0) & ((cki.Modifiers & ConsoleModifiers.Shift) == 0) & (cki.Key == ConsoleKey.T)) Console.WriteLine("If you press Shift+Alt+Ctrl+G it will show you the value of the key sequence");
- if (((cki.Modifiers & ConsoleModifiers.Alt) != 0) & ((cki.Modifiers & ConsoleModifiers.Control) != 0) & ((cki.Modifiers & ConsoleModifiers.Shift) != 0) & (cki.Key == ConsoleKey.G)) Console.WriteLine("Escape");
- } while (cki.Key != ConsoleKey.Escape);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement