This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Getch() waits for a keypress...


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]