Reputation: 203
I'm using Windows XP Home Edition. I want to set up a menu system that displays an image when the Enter key is pressed. Is there any way I can set up an if statement that executes when the Enter key is pressed on the keyboard without setting up a GUI. For example, can I just use the hex value associated with Enter key as a trigger for the if statement.
I've looked into reading input buffers. Am I going to have to get that complex with it? I don't really
Upvotes: 0
Views: 141
Reputation: 409356
For windows there are a couple of variants you could use to implement this:
std::getline
and discard the input._kbhit
and _getch
to check for the Enter key.Upvotes: 1