home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / programm / 4466 < prev    next >
Encoding:
Text File  |  1992-08-26  |  1.3 KB  |  36 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!mips!mips!rtech!ingres!seg
  3. From: seg@Ingres.COM (scott e garfinkle)
  4. Subject: Re: C Set/2 Problem with getch()
  5. Message-ID: <1992Aug26.222918.14442@pony.Ingres.COM>
  6. Organization: Ingres, an Ask Company
  7. References: <5s-n5j.feustel@netcom.com>
  8. Date: 26 Aug 92 22:29:18 GMT
  9. Lines: 25
  10.  
  11. In article <5s-n5j.feustel@netcom.com> feustel@netcom.com (David Feustel) writes:
  12. >I'm trying to use getch() in C Set/2 to read from the keyboard with no
  13. >echo. Link386 reports getch() not found. I tried to install the
  14. >migration libraries using the os/2 install command, but I get an error
  15. >message that install cannot write to a write-protected a disk.
  16. Did you try copying the disk, then doing the instal just to see what would
  17. happen?  getch() is, in fact, in the migration library.
  18.  
  19. >Is there a way to read without echo from the keyboard in full-screen
  20. >mode in 32-bit code? Thanks.
  21. Actually, I find it  just as convenient to use KbdCharIn  as getch().  They 
  22. are both 16 bit calls, anyway.  Code fragment:
  23. #define INCL_KBD
  24. #include <os2.h>
  25. {
  26.     KBDKEYINFO kbinfo;
  27.     KbdCharIn(&kbinfo, IO_WAIT, 0);    // use IO_NOWAIT if you don't want to wait
  28.     if((c = kbinfo.chChar) == 0|| c == 0xe0)
  29.     {
  30.         extended_char= TRUE;
  31.         c = kbinfo.chScan;
  32.     }
  33.     else
  34.         extended_char = FALSE;
  35. }
  36.