title: C++ How to get keyboard key press value (or number/code)
body: <p>I want to see which key is pressed by user.</p>
  
  <p>I know there is <code>cin()</code> or <code>getline(cin, var)</code> but I don't want an input, I want to get the number of the key(index, or code it is called?). </p>
  
  <p>For instance, I want to get if the user has pressed <code>F1</code> or <code>F10</code> or Enter or Escape and then in return do something proper.</p>
  
  <p>For instance:</p>
  
  <pre><code>if(user_has_pressed_escape)
  {
   exit_the_console();
  }
  </code></pre>