home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / os2 / programm / 6603 < prev    next >
Encoding:
Text File  |  1992-11-21  |  1005 b   |  33 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!uchinews!quads!soh3
  3. From: soh3@quads.uchicago.edu (min-woong sohn)
  4. Subject: Re: getchar() without <enter> in emx gcc?
  5. Message-ID: <1992Nov21.183800.19415@midway.uchicago.edu>
  6. Sender: news@uchinews.uchicago.edu (News System)
  7. Reply-To: soh3@midway.uchicago.edu
  8. Organization: University of Chicago 
  9. References: <1992Nov21.154701.16804@grebyn.com>
  10. Distribution: usa
  11. Date: Sat, 21 Nov 1992 18:38:00 GMT
  12. Lines: 19
  13.  
  14. In article <1992Nov21.154701.16804@grebyn.com> richk@grebyn.com (Richard Krehbiel) writes:
  15. >This is a very common FAQ in comp.lang.c, so I hate to ask....
  16. >
  17. >How do you read a single character from the keyboard without requiring
  18. >hitting ENTER, and without echo?
  19. >
  20.  
  21. It's in the emx doc. You need to use _read_kbd() as follows:
  22.  
  23. #include <stdlib.h>
  24. #define getch() _read_kbd(0,1,0)
  25. #define getche() _read_kbd(1,1,0)
  26.  
  27. Now getch() will not echo the character and getche() will.
  28.  
  29. Min
  30.  
  31.  
  32.  
  33.