Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ncar!gatech!prism!bb16 From: bb16@prism.gatech.EDU (Scott Bostater) Newsgroups: comp.lang.pascal Subject: Re: TV Editor Bug? Message-ID: <21564@hydra.gatech.EDU> Date: 8 Feb 91 19:31:35 GMT References: <5648@husc6.harvard.edu> Organization: Georgia Institute of Technology Lines: 54 In article <5648@husc6.harvard.edu> rind@popvax.uucp (747707@d.rind) writes: >I realize that not all the TP people have yet gotten 6.0, but I have >a Turbovision question. They supply an editor object (demonstrated in >TVEDIT.PAS in the TVDEMOS directory) which won't allow me to type >using the keys 3 4 5 6 or the shifts of those keys # $ % ^. Their demo >has the same problem as my program. The Turbo Editor in the IDE has no >problem with those keys. Any ideas as to what's going on. Can someone >else confirm this problem? (It occurred for me on 2 different PC's with >different keyboards.) Yes, it happens on my machine as well. I traced down the bug to the procedure ScanKeyMap. The problem was the scan code for a 3 is $0433 but was getting set to a Ctrl-Ins (kbCtrlIns = $0400). The code was checking only the high byte of the scan code. The fix is one line in the Editors.Pas source code (see below) ------------------ Fix to ScanKeyMap -------------------------------------- function ScanKeyMap(KeyMap: Pointer; KeyCode: Word): Word; assembler; asm PUSH DS LDS SI,KeyMap MOV DX,KeyCode CLD LODSW MOV CX,AX @@1: LODSW MOV BX,AX LODSW OR BL,BL JE @@2 CMP BL,DL JNE @@3 OR BH,BH JE @@4 @@2: CMP BX,DX { this is the line, had been: cmp bh,dh } JE @@4 @@3: LOOP @@1 XOR AX,AX @@4: POP DS end; ----------------------- End of Code ---------------------------------------- This fixed the problem for me. Note: I'm not positive if the pascal style comments work with the inline assembler or whether you need TASM style comments. I put it in after I tested the code to highlight the changed line. the code to highlight the a -- Scott Bostater Georgia Tech Research Institute - Radar Systems Analysis "My soul finds rest in God alone; my salvation comes from Him" -Ps 62.1 uucp: ...!{allegra,amd,hplabs,ut-ngp}!gatech!prism!bb16 Internet: bb16@prism.gatech.edu