*BSD News Article 70418


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.hawaii.edu!news.uoregon.edu!hunter.premier.net!news.mathworks.com!uunet!in2.uu.net!news.artisoft.com!usenet
From: Terry Lambert <terry@lambert.org>
Newsgroups: comp.unix.bsd.misc
Subject: Re: Q: Unix Terminal I/O
Date: Fri, 07 Jun 1996 21:38:03 -0700
Organization: Me
Lines: 20
Message-ID: <31B903AB.346B52F@lambert.org>
References: <4p7cuq$gmb@hammer.msfc.nasa.gov>
NNTP-Posting-Host: hecate.artisoft.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 2.01 (X11; I; Linux 1.1.76 i486)

Joe Gaines wrote:
] 
] I wanted to know if there was a function in the C-Programmer that lets
] you poll the keyboard.  In Microsoft C there is a function call
] kbhit() that lets you check the keyboard for an input.  Then you
] can use getchar() to retrieve the character.  If not is there a
] way to do this without using this particular function.  Your help
] is appreciated.

kbhit()		select() (use a zero-values timeval structure to
			  effect a poll).

getchar()	read() (avoid buffering if possible)


                                        Terry Lambert
                                        terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.