[comp.unix.programmer] Keypressed function?

djpadz@bonnie.ics.uci.edu (David Jay Padzensky) (02/27/91)

In Turbo Pascal on the IBMs, there's a function with the following
declaration:

	Function KeyPressed: Boolean;

All it does is return true or false based on whether or not a key is
waiting in the input buffer.  Is there a (DYNIX) C or Pascal function
that will do this?

Thanks in advance :)

--
Dj Padzensky
_______________________________________________________________________________
Internet: djpadz@bonnie.ics.uci.edu | Neurotics build castles in the sky.
America Online: DjPadz              | Psychotics live in them.  I sell them.

jik@athena.mit.edu (Jonathan I. Kamens) (02/28/91)

  The question you have asked is answered in the Unix Frequently Asked
Questions article, which is posted monthly to comp.unix.questions.  In
particular, it is question 7 in the article.

  Please read the FAQ article to obtain the answer to your question, and
furthermore, please read the whole article before posting any more questions
to the net, or, at the very least, check it in the future, before posting
questions.  If the article has expired from comp.unix.questions at your site,
E-mail me and I will send it to you.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710

gill@boris.mscs.mu.edu (Vijay (Ender) Gill) (02/28/91)

In article <27CB871A.2433@ics.uci.edu> djpadz@bonnie.ics.uci.edu (David Jay Padzensky) writes:

[---in turbo pascal there is ---]

>	Function KeyPressed: Boolean;
>
>All it does is return true or false based on whether or not a key is
>waiting in the input buffer.  Is there a (DYNIX) C or Pascal function
[--delted---]

>Dj Padzensky

The FAQ list has this question [7 I think].  However, reading
Marc J. Rochkind's book, "Advanced Unix Programming" will help,
in particular he gives the code for a `cready' function that
tells whether is a char is waiting, and `cget' to get it.
    That is an excellent book for programming in Unix, and is 
well worth the money spent.

cheers
-dicky gill (Violator)
-gill@boris.mscs.mu.edu