Clear Keyboard buffer (cont. held key)

For a game I'm coding, I need to check for continuously held keys. I read the key pressed with bioskey. How can I clear the buffer in each iteration of the while loop? Is there any other way to implement a continuously held key?
Sorry, when you say bioskey, does this seem about right? http://www.delorie.com/djgpp/doc/libc/libc_73.html

If so, then I would think it'd just be a matter of checking over and over again if a key is pressed (passing 1 as an argument).

-Albatross
Last edited on
this is how it looks and the problem I am having:
1
2
3
4
5
6
while()
{
        if(bioskey(1)) key=bioskey(0);    <--If keyboard buffer is not empty, get                                                                   .                                                                and remove one key data.
        //code here                                 <--If key is continuously held down,
                                                                then buffer gets filled here.
}
Are you writing this game with the windows API by any chance? There's a simple callback you can implement that does this with events without the use of polling for a keypress.
No, I'm using graphics.h with turbo c++ because its the only thing allowed for my school project.
Topic archived. No new replies allowed.