[fpc-pascal]readkey return
Lee, John
LeeJ at logica.com
Mon Sep 24 20:27:59 CEST 2001
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
-----Original Message-----
From: Jaakko Tamminen [mailto:jtamminen at satabaana.net]
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.
_______________________________________________
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
More information about the fpc-pascal
mailing list