From owner-freebsd-hackers Thu Dec 29 03:10:13 1994 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id DAA12365 for hackers-outgoing; Thu, 29 Dec 1994 03:10:13 -0800 Received: from hda.com (hda.com [199.232.40.182]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id DAA12355 for ; Thu, 29 Dec 1994 03:10:10 -0800 Received: (dufault@localhost) by hda.com (8.6.9/8.3) id GAA21554; Thu, 29 Dec 1994 06:10:25 -0500 From: Peter Dufault Message-Id: <199412291110.GAA21554@hda.com> Subject: Re: how to emulate kdhit()B? To: bde@zeta.org.au (Bruce Evans) Date: Thu, 29 Dec 1994 06:10:25 -0500 (EST) Cc: jbeukema@HK.Super.NET, freebsd-hackers@freefall.cdrom.com In-Reply-To: <199412290647.RAA10527@godzilla.zeta.org.au> from "Bruce Evans" at Dec 29, 94 05:47:59 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1161 Sender: hackers-owner@freebsd.org Precedence: bulk Bruce Evans writes: > > >This "kbhit" just returns whether or not something is pending, which > >is all the Microsoft library promised when this was written (way back when). > > Does the Microsoft one look at the keyboard or at stdin? I'm familiar > with the Borland one, which is documented to look on the keyboard, but > actually looks at stdin. > > Be sure to implement this bug correctly :-). The MS documentation says "the kbhit function checks the console for a recent keystroke". What it actually does is left as an exercise for a user with a DOS system nearby. We used this (and other than testing it to see that it works on FreeBSD it probably hasn't been used in about 4 years; the MS C documentation is copyright 1987) for developing programs that ran in either a DOS or BSD environment. At the time I think we had one Vaxstation and some SONY News systems and this is what worked best for us. Peter -- Peter Dufault Real Time Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936 dufault@hda.com Fax: 508 433 5267 ++++ Formerly hd@world.std.com. E-mail problems? Tell hdslip@iii.net