Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!apple!netcom!ergo From: ergo@netcom.UUCP (Isaac Rabinovitch) Newsgroups: comp.lang.pascal Subject: Re: Scan codes in TurboPascal Message-ID: <13363@netcom.UUCP> Date: 18 Sep 90 16:33:37 GMT References: <1561.26f20a24@waikato.ac.nz> Reply-To: ergo@netcom.uucp Organization: UESPA Lines: 35 In oivindt@ulrik.uio.no (Oivind Toien) writes: >> How do you pick up Scan codes in TP 5.5? >You can read the keyboard memory buffer. I do not have the specific >code you want, but take a look at these examples, they checks whether >the key is depressed: >Function CtrlPressed:Boolean; >begin > If (MEM[0:$417] and 4)<>0 > then CtrlPressed:=true > else CtrlPressed:=False; >end; >(further examples deleted) I guess that'll work just as well as my suggestion (using the intr function to ask for the shift byte), and it's probably a little more efficient. But whenever you access bios memory directly like that, you're demanding a higher level of IBM compatibility. I suppose most clone makers are at least this compatibile, but why take unnecessary risks? -- ergo@netcom.uucp Isaac Rabinovitch {apple,amdahl,claris}!netcom!ergo Silicon Valley, CA Collins's Law: If you can't make a mistake, you can't make anything. Corollaries ("Rabinovitch's Rules of Sane Dialogue"): 1. Everybody who matters is stupid now and then. 2. If I'm being stupid, that's my problem. 3. If my being stupid makes you stupid, that's your problem. 4. If you think you're never stupid, boy are you stupid!