title: How to handle key press event in console application
body: <p>I want to create a console application that will display the key that is pressed on the console screen, I made this code so far:</p>
  
  <pre><code>    static void Main(string[] args)
      {
          // this is absolutely wrong, but I hope you get what I mean
          PreviewKeyDownEventArgs += new PreviewKeyDownEventArgs(keylogger);
      }
  
      private void keylogger(KeyEventArgs e)
      {
          Console.Write(e.KeyCode);
      }
  </code></pre>
  
  <p>I want to know, what should I type in main so I can call that event?</p>