Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Jun 1996 21:23:24 -0700
From:      Jeremy Sigmon <jsigmon@access.mountain.net>
To:        freebsd-chat@freebsd.org
Subject:   Any alternatives for kbhit() and getch
Message-ID:  <31BF97BC.5E2D@access.mountain.net>

next in thread | raw e-mail | index | archive | help
Path: news.mountain.net!usenet
From: Jeremy Sigmon <jsigmon@access.mountain.net>
Newsgroups: comp.unix.programmer
Subject: Any alternatives for kbhit() and getch
Date: Wed, 12 Jun 1996 20:47:11 -0700
Organization: WVU Graduate Student
Lines: 19
Message-ID: <31BF8F3F.2052@access.mountain.net>
NNTP-Posting-Host: slip22-14.mountain.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.0 (Win16; I)

I am writing a timed program.  I need to be checking the
time while waiting for input.  This is to be written as much as
possible in ANSI C.

With DOS(gak) I would use:

while(!kbhit());
char_input = getch();

But kbhit isn't available and the getch() routines in curses
have some very funny properties.  For instance a CR isn't counted
as a character for the above routine and such....

Are there any implementations of these two functions for UNIX?
Or any suggestions using other functions?

thanks

Please reply by EMail because I only check this once per week.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?31BF97BC.5E2D>