✔ 最佳答案
program test_readkey;
uses wincrt;
var
c : char;
begin
c:=readkey;
case c of
#8 : writeln(’You presses backspace’);
#9 : writeln(’You presses tab’);
#13: writeln(’You presses enter’);
#27: writeln(’You presses escape’);
#32: writeln(’You presses space’);
#48: writeln(’You presses 0’);
#49: writeln(’You presses 1’);
#50: writeln(’You presses 2’);
#51: writeln(’You presses 3’);
#52: writeln(’You presses 4’);
#53: writeln(’You presses 5’);
#54: writeln(’You presses 6’);
#55: writeln(’You presses 7’);
#56: writeln(’You presses 8’);
#57: writeln(’You presses 9’);
else writeln(’You presses other key’);
end;
end.
只要搵返個制既 ASCII value 就得.
2006-10-30 23:21:46 補充:
同左邊 keyboard 果 D 一樣.