This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Getch() waits for a keypress...
- To: <gcc at gcc dot gnu dot org>
- Subject: Re: Getch() waits for a keypress...
- From: "Programma Computer" <programma at tin dot it>
- Date: Tue, 24 Apr 2001 16:54:58 +0200
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.