So, I recently emplemented some code that used some other buttons on the keyboard, I used GetAsyncKeyState() to do it.
The function I used goes like this:
1 2 3 4 5 6 7 8 9 10 11 12
bool enter_key()
{
bool p = false;
while(GetAsyncKeyState(VK_ENTER))
{
if(!p)
{
p = true;
}
}
return p;
}
Quite simple really. It performs the while loop while the key is pressed, so the user has to let go for it to do somthing, which garuntees a single key press.
The problem is, for some reason, I will press the enter key, or somthing, and then if I press any other key it returns true! I can not figure this out for the life of me, and I'm starting to question whether it may be a problem with Windows 8, or my library/compiler... This has never happened before.