Function like kbhit()



Hi guys,

I need a function like kbhit. i.e function which gets a input from keyboard, but
doesn't wait.

kbhit() : when user press a key give 1 other gives 0, I need function giving
input entered by users without waiting.

Thank you...


Last edited on
Thank you but capture key stroke's function is the same getch().
It waits until user press a key
GetAsyncKeyState. Search that.
That, or...

1
2
3
4
5
6
7
8
9
10
11
while (true)
{
    if (kbhit())
    {
        char c=getch();

        //...
    }

    //...
}

Though, I'd prefer OS specific ways to do this (i.e. the GetAsyncKeyState function mentioned above)
Last edited on
Topic archived. No new replies allowed.