Hello. My question involves cin as a way to gather user input. When I run the program below and press backspace to inter input, the keystrokes previously pressed will automatically be entered into the input space.
For example, if I press ggghhh while I’m moving around with the arrows and press backspace, ggghhh will pop into the input field before I type anything. (Which also happens with the direction keys or q - for quit - if I were to use GetAsyncKeyState instead of GetKeyState.)
I’ve tried clearing the buffer right before I ask for input, but that hasn’t helped. Is there a method to collect user input without having the previously pressed keys clog the field?