Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site unc.unc.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!harvard!talcott!panda!genrad!decvax!mcnc!unc!ericksen
From: ericksen@unc.UUCP (James P. Ericksen)
Newsgroups: net.lang.pascal
Subject: Re: Turbo Pascal question
Message-ID: <133@unc.unc.UUCP>
Date: Mon, 12-Aug-85 17:14:27 EDT
Article-I.D.: unc.133
Posted: Mon Aug 12 17:14:27 1985
Date-Received: Sun, 18-Aug-85 20:44:32 EDT
References: <133@rtp47.UUCP>
Organization: CS Dept, U. of N. Carolina, Chapel Hill
Lines: 25

> Is there a way in Turbo V3 to find out what the key was pressed if
> the 'keypressed' function returns true?
> 
> I want to take different actions depending on what the key is, but I don't
> know how to do a single character read.
> 

I assume your problem is that you are using
	Read (input, c);	(* c is a character variable *)

which waits for a carriage return before proceeding (input is buffered).
For unbuffered keyboard input, use
	Read (kbd, c);

By the way, the best way around Turbo's brain damaged check-for-break-key
(which can cause the character detected by the Keypressed function to dis-
appear) is to disable checking for break key by putting
	(*$C-*)
at the start of your program (necessary for sane operation of any program
which reads the keyboard).


Jim Ericksen
Dept of Comp Sci
UNC Chapel Hill