Check if a key has been pressed and released
I would like my application to have a while-loop that goes on as long as a certain key isn't pressed. As soon it's pressed it will make the while expression false and leave.
I know the GetAsyncKeyState()-function but it can't see if a key has been pressed and released since it only returns the keystate when the function is called. Is there a way to find out if something has happend to a key even if it's not pressed when the function is called but instead pressed somewhere else in the loop?