home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.os2.programmer
- Path: sparky!uunet!grebyn!daily!richk
- From: richk@grebyn.com (Richard Krehbiel)
- Subject: Re: getchar() without <enter> in emx gcc?
- In-Reply-To: richk@grebyn.com's message of Sat, 21 Nov 1992 15:47:01 GMT
- Message-ID: <1992Nov22.190518.5854@grebyn.com>
- Lines: 28
- Sender: richk@grebyn.com (Richard Krehbiel)
- Organization: Grebyn Timesharing
- References: <1992Nov21.154701.16804@grebyn.com>
- Distribution: usa
- Date: Sun, 22 Nov 1992 19:05:18 GMT
-
-
- Let me post the answer to my own question:
-
- 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);
-
- add this-> tio.c_lflag &= ~IDEFAULT;
-
- > 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.
-
- I don't know what it means or why it's needed. I looked at the
- patches for emacs and found this, and it worked.
- --
- Richard Krehbiel richk@grebyn.com
- OS/2 2.0 will do for me until AmigaDOS for the 386 comes along...
-