Keypressed exists?

Rich Walters raw at math.arizona.edu
Thu Feb 15 14:16:24 AEST 1990


In article <1990Feb10.190053.15413 at alzabo.uucp> tris at alzabo.uucp (Tris Orendorff) writes:
>ron at clarity.Princeton.EDU (Ronald Beekelaar) writes:
>
>>Hi
>
>>  I have a very simple question, although I can't find the answer myself. How
>>do you quietly test whether any key was pressed on the keyboard? I want to
>>write a function that waits 10 seconds, if any key had been pressed, but
>>doesn't wait at all, if none was pressed. 
>
>In Microsoft C V5.1 you can use the functions kbhit () and getch ().
>See section 4.8.3 in the run-time library reference book.
>
>
Unix BSD has something similar but you must use cbreak mode which entails a lot
of other overhead. Like reading the termcap/terminfo file and doing all kinds
of setup yourself.  Most of what you need is included, but I don't remember
where off the top of my head.

			Richard Walter


-------------------------------------------------------------------------------

			Keep crunching those numbers

-------------------------------------------------------------------------------



More information about the Comp.lang.c mailing list