Subject: Read from keyboard?
From: [email-masked] ("Neal Krawetz")

31 Aug 1997 16:25:56 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: "Neal Krawetz" <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "[email-masked]" <[email-masked]>
X-Mailer: Generic Mailer (5.87)
Original-Sender: [email-masked]

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
"[email-masked]" with one line of text: "help".