Getch() waits for a keypress...

Alexandre Oliva aoliva@redhat.com
Tue Apr 24 07:27:00 GMT 2001


On Apr 24, 2001, "Programma Computer" <programma@tin.it> wrote:

> Function Getch() stops the execution of the program till the user press a
> key. On other platforms/compilers this function do not wait for the
> keypress.

You can always reopen stdin in O_NONBLOCK mode.

> 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.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Gcc mailing list