home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!cs.utexas.edu!asuvax!chnews!hfglobe!imutm1.de.intel.com!gold.sub.org!jonas.gold.sub.org!rommel
- From: rommel@jonas.gold.sub.org (Kai Uwe Rommel)
- Newsgroups: comp.os.os2.programmer
- Subject: Re: getchar() without <enter> in emx gcc?
- Distribution: world
- Message-ID: <722381443rommel.root@jonas.gold.sub.org>
- Sender: root@jonas.gold.sub.org
- Date: Sat, 21 Nov 92 22:30:43 MET
- References: <1992Nov21.154701.16804@grebyn.com>
- Organization: Private
- Lines: 38
-
- In article <1992Nov21.154701.16804@grebyn.com> richk@grebyn.com (Richard Krehbiel) writes:
- >How do you read a single character from the keyboard without requiring
- >hitting ENTER, and without echo?
- >
- >Specifically, this is in emx gcc 0.8e. I'm incuding what I'm trying
- >now, but it doesn't work. It does in Unix, which I thought the termio
- >interface in emx was supposed to emulate.
- >
- > setbuf(stdin, NULL);
- > ioctl(0, TCGETA, &tio);
- > tio.c_lflag &= ~(ICANON | ECHO);
- > tio.c_cc[VMIN] = 1;
- > tio.c_cc[VTIME] = 0;
- > tio.c_cc[VEOL] = 0;
- > ioctl(0, TCSETA, &tio);
- >
- >After this, characters are still automatically echoed and buffered,
- >etc.
-
- First, check the EMXDEV.DOC file. You will find
-
- a) _read_char()
-
- b) TERMIO which allows things like the above
-
- Unfortunately, TERMIO is sometimes tricky to work with. I would
- suggest you to look at/try the /emx/test/termio.c sample code and
- figure out how it works.
-
- Kai Uwe Rommel
-
- --
- /* Kai Uwe Rommel Muenchen, Germany *
- * rommel@jonas.ucrc.sub.org Phone +49 89 723 4101 *
- * rommel@informatik.tu-muenchen.de Fax +49 89 723 7889 */
-
- DOS ... is still a real mode only non-reentrant interrupt
- handler, and always will be. -Russell Williams
-