I want to see which key is pressed by the user.
I know that there is cin()or getline(cin, var), but I do not need an input, I want to get the key number (index or code that it is called?).
For example, I want to get if the user presses F1either F10either Enter or Escape, and then do something appropriate in return.
For instance:
if(user_has_pressed_escape)
{
exit_the_console();
}
source
share