Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!snorkelwacker!apple!bbn.com!gateway!ANDREW.CMU.EDU!vd09+ From: vd09+@ANDREW.CMU.EDU ("Vincent M. Del Vecchio") Newsgroups: comp.emacs Subject: Re: unbufferd input; hypercard emulator Message-ID: <1362@archive.ARCHIVE.BBN.COM> Date: 6 Sep 90 19:47:52 GMT References: <12553@sdcc6.ucsd.edu> Sender: news@bbn.com Organization: BBN news/mail gateway Lines: 23 I'm not sure what this has to do with Emacs, but I'll respond anyway. What you have to do is turn off the buffering on the tty. Generally, check the tty man pages to find out more (and possibly check ioctl as well). In BSD4.3 (can't verify for anything else, but it will be fairly similar), this should work: #include struct sgttyb buf; ioctl(0,TIOCGETP, &buf); buf.sg_flags |= CBREAK; ioctl(0,TIOCSETP, &buf); Then, when you read() or getchar(), it will return immediately. +----------------------------------------------------------------------------+ | Vincent Del Vecchio \ Disclaimer: Views expressed are not necessarily | | Box 4872 \ those of any person/group I am associated with. | | 5125 Margaret Morrison St.\ UUCP: {uunet,harvard}!andrew.cmu.edu!vd09 | | Pittsburgh, PA 15213 \ BITNET: vd09+%andrew@cmuccvma.bitnet | | (412) 268-4441 \ Internet: vd09+@andrew.cmu.edu | +----------------------------------------------------------------------------+