Path: utzoo!utgpu!water!watmath!clyde!rutgers!mit-eddie!uw-beaver!uw-june!pardo From: pardo@june.cs.washington.edu (David Keppel) Newsgroups: comp.lang.c Subject: Re: keypressed() Message-ID: <4230@june.cs.washington.edu> Date: 17 Feb 88 21:41:37 GMT References: <136@forty2.UUCP> Reply-To: pardo@uw-june.UUCP (David Keppel) Organization: U of Washington, Computer Science, Seattle Lines: 14 In article <136@forty2.UUCP> eschle@forty2.UUCP (Patrik Eschle) writes: [ how to do "char=keypressed()" returns 0 if none pressed? ] >I can't use curses and have played around with ioctl, but its >really slow. (Everybody: please include a return address. I don't have domain uucp!) On BSD Un*x you can use the "select()" call to wait for a stream to become ready; if the "timeout" parameter is zero (NOT a zero pointer!) the call will return immediately. I have no idea what the performance is compared to ioctl(), I'd guess it is less device-dependent than ioctl(). On some (many?) PCs, you can read the keyboard or controller directly. ;-D on (Not an answer, but at least not a question!) Pardo