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