Getch() waits for a keypress...

Programma Computer programma@tin.it
Tue Apr 24 07:49:00 GMT 2001


Alexander,

thankyou for the speedy reply.

>You can always reopen stdin in O_NONBLOCK mode.

Have You any sample to give me ?. Please, be patient, I'm a newbie.

>> Another question: is there any function I can use to put a character
>> in the keyboard buffer ?
>
>Nope. The keyboard buffer is several layers of abstraction down
>inside the kernel. You may use ungetc() to push a character back into
>stdin.

As far as I know, ungetc() will put the character before any other pending
in stdin.
I want to put it after the others. Can I do this ?
Or, is there any way to know if a character is pending in the buffer before
using getch() to retrieve it ?

Thankyou very, very much.
Davide.




More information about the Gcc mailing list