the way to do it, see documentation for fpc ...eg
Example
Program Example3;
uses Crt;
{ Program to demonstrate the ReadKey function. }
var
ch : char;
begin
writeln('Press Left/Right, Esc=Quit');
repeat
ch:=ReadKey;
case ch of
#0 : begin
ch:=ReadKey; {Read ScanCode}
case ch of
#75 : WriteLn('Left');
#77 : WriteLn('Right');
end;
end;
#27 : WriteLn('ESC');
end;
until ch=#27 {Esc}
end.
hth
Earlier message 30 lines
-----Original Message-----
From: Jaakko Tamminen
Sent: Monday, September 24, 2001 06:10
To: Free Pascal
Subject: [fpc-pascal]readkey return
Hi
For some reason I get the same code for shift-s (uppercase s) and
DEL-key when I do following:
var ch : char;
...
repeat until keypressed;
ch := readkey;
case ch of
#83 : del_cur_ch; {<-- this happens with upcase-S and DEL key ?}
Is there another way to read a pressed key, so that I could see the
difference between upcase-S and DEL-key?
I'm programming in Linux ascii-console, and using FPC 1.0.4
Jaska.