Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!ira.uka.de!smurf!artcom0!hb.maus.de!ms.maus.de!Kai_Henningsen From: Kai_Henningsen@ms.maus.de (Kai Henningsen) Newsgroups: comp.lang.pascal Subject: Readkey alternative? Message-ID: <14185@ms.maus.de> Date: 27 Apr 91 12:05:00 GMT Distribution: world,comp Organization: Maus Mailbox Netz - UUCP-Gateway Bremen Lines: 45 fer9483 @ tesla.njit.edu schrieb am 22.04.1991, 13:49 fe>I am writing a door for a friends BBS.. everything is fine except for one fe>thing, the output doesn't work if i include the CRT unit.. this is fe>not on my end, but on the BBS's and the way it handles output.. now this fe>is all fine and dandy except for i need a function like readkey without fe>using the crt unit.. just something that gets a key without waiting for fe>a carriage return.. Well, I won't start explaining the old Crt-rewrite('')-problem, as that wouldn't solve your problem; I'll only say that readkey works ONLY with the keyboard. There are several ways to work with the serial port instead; however, if you want to use normal DOS redirection (which, from your description, I assume), then the obvious solution seems to be using the DOS character I/O functions. There are several; you might try each to determine which works best for you: AH=01 -> AL=char Character input with echo ^C works AH=06 DL=FF -> AL=char Direct console I/O ^C is normal char AH=07 -> AL=char Unfiltered character input without echo ^C is normal char AH=08 -> AL=char Character input without echo ^C works You might also consider, for a replacement to keypress, AH=0b -> AL=00/FF Check input status ^C works For an example of how to use these: uses DOS; function ReadKeyDOS: char; var r: registers; begin r.ah:=$07; msdos(r); ReadKeyDOS:=chr(r.al); end; I'm not sure, but I believe ^C recognition can be disabled completely by putting the input device into "raw" mode via an ioctl. If you need that, ask again, and I'll look it up. MfG Kai