Ok, heres a much shorter version. I commented like everything to help you understand
.
Code:
program Blah;
var
I : Integer;
begin
while True do { Constantly running until terminated }
for I:= 1 to 255 do { do the following proccess from I being 1 to 255 }
if(IsKeyDown(Chr(I)))then { As variable I increases, it checks to see if the character value of I is being pressed }
Writeln('Key ' + IntToStr(I) + ', also known as "' + Chr(I) + '" has been pressed'); { If keyboard character value of variable I is pressed, output it to the debug box }
end.
EDIT : To work on, try making the script output once for every key press instead of flooding the debug box at every tap of a key.
Also, I see in one of your scripts, an error
. Oh noes:
Code:
Case Random(4) of
0 : Writeln('No message assigned!');
1 : Writeln(Message1);
2 : Writeln(Message2);
3 : Writeln(Message3);
4 : Writeln(Message4);
end;
Random(4) returns a value between 0 and 3, it's just the was it works. To make yours work you should make it "case Random(5) of".