-
continues input
I want to make somthing that generates continues input weather a key is pressed or not:
this is what iv'e got so far to try and explain what i mean...
Code:
For(;;)
{
system("cls"); //clears the screan ready for input
getch(); //Gets Input
switch //used to deal with what the input means
{
}
} // End Of for
the thing with this is when it hits getch(); the system pauses and waits for input
how do i meake it skip the input if no keys are being pressed?
or did i just bite off more then i can chew?
~Matty-Alan~
-
You can't do this in plain vanilla C. You have to use non-portable methods to do this, some of which might be portable within an O/S family (ie. a Windows or a Unix/Linux manner).
-
you want a non-blocking operation. The C standard doesn't really have those. You'll have to use an OS API, which I'm guessing is more than you can chew right now. nonetheless, there are some win32 reference links in the windows programming board.