TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Paul Person
from: Mario Semo
date: 1996-03-20 11:42:28
subject: Re: next .

Hello Paul,

On Mar 17 06:58 96, Paul Person of 1:343/179 wrote:

 PP> Pardon me for butting in, but I believe the question 
 PP> involved using KbdCharIn(), not getch(). You wouldn't, by 
 PP> any chance, be using getch() because you know that 
 PP> KbdCharIn() doesn't work, would you? 

????????????

buy MS-C's CRT source if you want and look want getch() is doing! Of course
i can use KbdCharIn too, but i want unget() etc too and thats why i'm using
getch. 

OF COURSE KBDCHARIN works too.

and a small tip: TRY AND THINK before WRITE!.

 PP> The documented behavior of KbdSetStatus() in a Vio-windowed 
 PP> application is "ignored". That is, PRCP.INF states (I 
 PP> presume) that it won't work in a windowed command-line 
 PP> session. 

Just TRY. PRCP.INF is from OS/2 1.3 toolkit and is about 7 years old.

here's my last comment on this issue:


#define INCL_KBD
#include 

#include 

#define _PHYS_KEYBRD    0

int myGetch(void)
{
 KBDINFO kbstInfo;
 USHORT fsMask;
 KBDKEYINFO kbci;

 kbstInfo.cb = sizeof(kbstInfo);

 KbdGetStatus(&kbstInfo, _PHYS_KEYBRD);
 fsMask           = kbstInfo.fsMask;
 kbstInfo.fsMask &= ~KEYBOARD_ASCII_MODE;
 kbstInfo.fsMask |=  KEYBOARD_BINARY_MODE;
 KbdSetStatus(&kbstInfo, _PHYS_KEYBRD);
 KbdCharIn(&kbci, IO_WAIT, _PHYS_KEYBRD);
 return((int)kbci.chChar);
}

main(int argc, char *argv[], char *envp[])
{
 for (int i=0; i<5; i++)
    printf("%d\n",myGetch());
}

PS: the MS-C getch code can be found in \C600SRC\LATTICE\OS2\GETCH.ASM

 WARPED!, Mario

--- Msgedsq/2 2.2e
* Origin: LC/32 Development Team-Vienna-Austria (2:310/14.11)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 310/14 1 24/999 2/777 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.