I have program, then it's running it asks stuffs and then user has to press 1 to proceed I use GetKeyState() function to decide if number was pressed and SetKeyboardState() to set keys states back to original, but it doesn't work after second attempt. Whats wrong?
Code:
BYTE States[256];
GetKeyboardState(States); 
cout << press 1 << endl;
while(!Started)
{
    if(GetKeyState(VK_NUMPAD1))
    {
        Started = true;
    }
}
SetKeyboardState(States);
cout << "press 1" << endl;
while(!Name)
{
    if(GetKeyState(VK_NUMPAD1))
    {
        Name = true;
    }
}
SetKeyboardState(States);
cout << "press 1" << endl;
while(!Located)
{
    if(GetKeyState(VK_NUMPAD1))
    {
        Located = true;
    }
}