home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.th-darmstadt.de!rbg.informatik.th-darmstadt.de!misar
- From: misar@rbg.informatik.th-darmstadt.de (walter misar)
- Subject: Re: >>>> * Get keypress * <<<<
- Sender: news@news.th-darmstadt.de (The News System)
- Message-ID: <1992Nov9.105147@rbg.informatik.th-darmstadt.de>
- Date: Mon, 9 Nov 1992 09:51:47 GMT
- References: <1992Nov7.154748.24501@alf.uib.no>
- Nntp-Posting-Host: rbhp64.rbg.informatik.th-darmstadt.de
- Organization: TU Darmstadt
- Lines: 22
-
- In article <1992Nov7.154748.24501@alf.uib.no>, singg@alf.uib.no (Kurt George Gjerde) writes:
- > How do I read a keypress (char) without having the user to
- > press Return??
- >
- > System = Unix V.
- >
- Hm, set the terminal to raw mode, on HP-UX it will look like this:
-
- #include <sgtty.h>
- ...
- { char buf[1];
- struct sgttyb *ttyio;
-
- gtty(0,ttyio);
- (ttyio->sg_flags)|=(RAW);
- stty(0,ttyio);
- ...
- read(0,buf,1); /* read one char, don't wait for return */
- ...
- }
-
- Walter
-