[fpc-pascal]readkey return

Jaakko Tamminen jtamminen at satabaana.net
Mon Sep 24 22:20:36 CEST 2001


Thank You for this info.

Now it works, except END-key.. it seems to give 3 (!) codes... but I 
can live without that key... :-)

Jaska.


Viestissä Maanantai 24. Syyskuuta 2001 21:27, Lee, John kirjoitti:
> 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.
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal





More information about the fpc-pascal mailing list