From: nealk@net66.com ("Neal Krawetz")
Subject: Read from keyboard?
31 Aug 1997 16:25:56 -0700
Approved: cygnus.gnu-win32@cygnus.com
Distribution: cygnus
Message-ID: <199708311543.KAA01411.cygnus.gnu-win32@winslow.net66.com>
Reply-To: "Neal Krawetz" <nealk@net66.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "gnu-win32@cygnus.com" <gnu-win32@cygnus.com>
X-Mailer: Generic Mailer (5.87)
Original-Sender: owner-gnu-win32@cygnus.com

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