home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / os2 / programm / 6612 < prev    next >
Encoding:
Internet Message Format  |  1992-11-22  |  1.8 KB

  1. 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
  2. From: rommel@jonas.gold.sub.org (Kai Uwe Rommel)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: getchar() without <enter> in emx gcc?
  5. Distribution: world
  6. Message-ID: <722381443rommel.root@jonas.gold.sub.org>
  7. Sender: root@jonas.gold.sub.org
  8. Date: Sat, 21 Nov 92 22:30:43 MET
  9. References: <1992Nov21.154701.16804@grebyn.com>
  10. Organization: Private
  11. Lines: 38
  12.  
  13. In article <1992Nov21.154701.16804@grebyn.com> richk@grebyn.com (Richard Krehbiel) writes:
  14. >How do you read a single character from the keyboard without requiring
  15. >hitting ENTER, and without echo?
  16. >
  17. >Specifically, this is in emx gcc 0.8e.  I'm incuding what I'm trying
  18. >now, but it doesn't work.  It does in Unix, which I thought the termio
  19. >interface in emx was supposed to emulate.
  20. >
  21. >        setbuf(stdin, NULL);
  22. >        ioctl(0, TCGETA, &tio);
  23. >        tio.c_lflag &= ~(ICANON | ECHO);
  24. >        tio.c_cc[VMIN] = 1;
  25. >        tio.c_cc[VTIME] = 0;
  26. >        tio.c_cc[VEOL] = 0;
  27. >        ioctl(0, TCSETA, &tio);
  28. >
  29. >After this, characters are still automatically echoed and buffered,
  30. >etc.
  31.  
  32. First, check the EMXDEV.DOC file. You will find 
  33.  
  34. a) _read_char()
  35.  
  36. b) TERMIO which allows things like the above
  37.  
  38. Unfortunately, TERMIO is sometimes tricky to work with. I would
  39. suggest you to look at/try the /emx/test/termio.c sample code and
  40. figure out how it works.
  41.  
  42. Kai Uwe Rommel
  43.  
  44. --
  45. /* Kai Uwe Rommel                                      Muenchen, Germany *
  46.  * rommel@jonas.ucrc.sub.org                       Phone +49 89 723 4101 *
  47.  * rommel@informatik.tu-muenchen.de                  Fax +49 89 723 7889 */
  48.  
  49. DOS ... is still a real mode only non-reentrant interrupt
  50. handler, and always will be.                -Russell Williams
  51.