Delphi For Loop Help
This is the code i use, but the timer for loop doesn't terminate and shows a message box up loads of times. It should only show the message box up when a key is pressed and should only show it once
Could anyone help me?
- Code: Select all
procedure TForm2.keyloggerTimer(Sender: TObject);
var
i: Integer;
key: String;
begin
for i := 97 to 122 do
begin
if GetAsyncKeyState(i) <> 0 then
key := key + Chr(i);
ShowMessage(key);
end;
end;
Could anyone help me?