#include <iostream>
#include <windows.h>
#include <conio.h>
usingnamespace std;
int main()
{
cout<<"Press any key: ";
getch(); //waits for the user to hit a key
if(GetAsyncKeyState(VK_DOWN)) //if the user hit the down arrow key
cout<<"\nYou pressed the down arrow key";
return 0;
}
Probably means it was running successfully, but very fast.
Without seeing more of your code, it's hard to say what's happening. But if you have a main loop which goes around and around, updating the screen and checking for keystrokes, chances are it's going faster than you actually need.
I'm totally guessing here. You might try putting in a Sleep(n); delay in there where n is a number of milliseconds.
Actually getting the key is a little more involved. I don't have much time this moment to give you something exactly what you need, but you have to play with "unbuffered input" to do it. Here are a few threads to help get started: