Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!hsdndev!cmcl2!adm!news From: TOMJ@csdserver3.csd.scarolina.edu (Thomas E. Jenkins, Jr.) Newsgroups: comp.lang.pascal Subject: Re: Extracting from a unit (or CRT vs. ANSI) Message-ID: <26450@adm.brl.mil> Date: 4 Apr 91 14:53:22 GMT Sender: news@adm.brl.mil Lines: 61 Hi, Try this: 4. Use Intr to call BIOS routines to perform your own ReadKey & KeyPressed. USES DOS ; FUNCTION KeyPressed : BOOLEAN ; VAR regs : Registers ; BEGIN FillChar ( regs , SizeOf ( regs ) , #0 ) ; regs.ah := $01 ; { func 01h will wait on key to be pressed } { if buffer is empty. func 11h for } { extended keyboards } Intr ( $016 , regs ) ; KeyPressed := ( regs.flags AND FZero ) = 0 ; END ; { KeyPressed } FUNCTION ReadKey : CHAR ; VAR regs : Registers ; BEGIN FillChar ( regs , SizeOf ( regs ) , #0 ) ; regs.ah := $00 ; Intr ( $16 , regs ) ; ReadKey := Chr ( regs.ah ) ; { note al has scan code if needed } END ; { ReadKey } Hope this helps, tom +--------------------------------------------------------------------------+ | Thomas E. Jenkins, Jr. Programmer, University of South Carolina CSD | +--------------------------------------------------------------------------+ | BITNET : C0361@UNIVSCVM.BITNET | CSDNET : tomj/csdserver3 | | INTERNET : TOMJ@csdserver3.csd.scarolina.EDU {PREFERRED} | | : C0361@univscvm.csd.scarolina.EDU | 129.252.43.30 | | FROM Compuserv : INTERNET:TOMJ@csdserver3.csd.scarolina.EDU {PREFERRED} | | : INTERNET:C0361@univscvm.csd.scarolina.EDU | +--------------------------------------------------------------------------+