[fpc-pascal]readkey return

yendor at nic.fi yendor at nic.fi
Mon Sep 24 22:01:36 CEST 2001




Jaakko Tamminen <jtamminen at satabaana.net> sanoi:

> 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

Bweep bweep. Try
ch := readkey;
if ch = #0 then ch := readkey;

This is because some of the more special keys are prefixed by #0 or even 
more key codes.

________________________________________________________________
Ilmainen Internet @ http://www.nic.fi/





More information about the fpc-pascal mailing list