I have a console game where the player uses the keys W, A, and D to move. I get the key input using the getKeyState()
function in the <windows.h>
lib.
However, when I prompt the player to play again using std::cin
, all the keyboard inputs are shown, and the user has to delete all of the characters manually.
You could encounter the same problem if something like this happens:
Sleep(10000) // user types something here
char input;
std::cin << input; // user sees what they typed here
Is it possible to clear this so the user does not see what they previously typed?