Read from keyboard?

Neal Krawetz nealk@net66.com
Sun Aug 31 13:43:00 GMT 1997


Hello,

I have a text-based application that has been successfully ported to OS/2,
SunOS, Linux, IRIX, and HP-UX.  (The only difference is the non-blocking
read from a keyboard function.)  I'd like to port it to Win95.

I have tried GCC and an older version of Cygnus-GCC, but both seem to be
unable to perform a non-blocking read from a text-based application.

I'm basically looking for "int getch(stdin)" where it returns the
character in the read buffer, or -1 if no character is available.

Under GCC for OS/2, the function _read_kbd(0,0,0) does exactly what I
want.  Under Unix, we use curses to set stdin to non-blocking.

Is a possible to make a text-based application with non-blocking read from
stdin using the current Cygnus GCC compiler?  If so, how?

(I wrote about 6 months ago with the same question and was told that it
currently cannot be done, but may be possible in the future.)

						-Neal


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list