title: How to disable user's input and escape of the loop when user act in c#?
body: <p>today I have very simple question that I know probably it will have bad feedback. I want to get out of a loop that disable user input on a console application using c#. I have this:</p>
  
  <pre><code>while (true) {
              Console.ReadKey (true);
          }
          string key = Console.ReadKey().Key.ToString();
              if (key.ToUpper() == "F10") {
              Console.WriteLine ("Hello!");
          }
  </code></pre>
  
  <p>Basicly, I want to disable the user of writing on the console but I want that when the user press F10 something happens.</p>
  
  <p>Thank you for your time. Bye.</p>