I am currently creating a console game for school and am having problems using GetAsyncKeyState for my main menu. My main menu runs in an endless loop that only breaks after a key is pressed. For example, I have:
if(GetAsyncKeyState('1')) { Play(); break; }
This, alone, works great. The problem is that in my Play () method, I have a cin instruction right from that bat, and "1" from the menu () is included in my Play (). I tried cin.clear () to no avail, and cin.ignore (...) prevents an instant change from Menu () to Play (). Is there any way to prevent this?
source share