Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: sl AT psycode DOT com (sl), djgpp AT delorie DOT com Date: Tue, 19 May 1998 09:21:11 +0000 MIME-Version: 1.0 Content-type: Multipart/Mixed; boundary=Message-Boundary-15486 Subject: Re: RHIDE 1.4.5 CC: Robert Hoehne Precedence: bulk --Message-Boundary-15486 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Last Week Gili posted a bug report about RHIDE 1.4.5 handling the NumLock key in a wrong way. At first I didn't understood what he was trying to explain but then Vik explained it clearlly. I "fixed" it, even when I don't know if can name it a fix. The fact is that this IS the BIOS behavior. BIOS reports the keys in the following way: Num Lock ON: Gray 6 => ASCII 6 Shift + Gray 6 => ASCII 0 but the scan to figure out that is the right key. Num Lock OFF: Gray 6 => ASCII 0 and SCAN just like before. Shift + Gray 6 => ASCII 6 ?!!!!!!! If course command.com behaves like the current RHIDE 1.4.5 so I don't know if this behavior is a bug, and is this case the bug is in the BIOS. Anyways, the new code traps the Shift+Key==Number and remaps it, I think it will produce the desired effect. The patched version will be included in the next release of the editor. Here is the code you can use to check it: #include #define REGS __dpmi_regs #define INTR(nr,r) __dpmi_int(nr,&r) int main(int argc, char *argv[]) { REGS r; do { r.h.ah=0x10; INTR(0x16,r); printf("ASCII: %d (%c) SCAN: %d\n",r.h.al,r.h.al,r.h.ah); } while (r.h.al!=27); return 0; } SET P.S. The attached file is the patch for TVision code. ------------------------------------ 0 -------------------------------- Visit my home page: http://set-soft.home.ml.org/ or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013 --Message-Boundary-15486 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Text from file 'dif' --- rhide-1.3b/tvision/gkey.cc~ Sat Feb 28 17:26:18 1998 +++ rhide-1.3b/tvision/gkey.cc Fri May 15 20:01:18 1998 @@ -201,6 +201,7 @@ kbX,kbY,kbZ,kbOpenCurly,kbOr,kbCloseCurly,kbTilde,kbBackSpace }; + unsigned short getshiftstate(void) { if (TGKey::useBIOS) @@ -246,6 +247,7 @@ GetRaw(); // Compose the shift flags: + if (sFlags & 3) Abstract|=kbShiftCode; if (sFlags & 4) @@ -312,7 +314,16 @@ { unsigned char val=kbByASCII[rawCode.b.ascii]; if (val<128) - Abstract|=val; + { + // I think the following is a bug in the BIOS: Numlock OFF then + // key pad 6 is right, OK, but if you press shift+6 you get the + // ASCII of 6!!!! + if (rawCode.b.ascii>='0' && rawCode.b.ascii<='9' && + (Abstract & kbShiftCode)) + Abstract|=kbWithASCIIE0[rawCode.b.scan]; + else + Abstract|=val; + } else { val&=0x7F; --Message-Boundary-15486--