unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
StdCtrls,
Windows;
type
{ TForm1 }
TForm1 = class(TForm)
Memo1: TMemo;
Timer1: TTimer;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Timer1Timer(Sender: TObject);
var
Tasto, i: integer;
Esci: boolean;
begin
i:=0;
Esci:=FALSE;
while ((i<=255)AND(Esci=FALSE)) do
begin
if (GetAsyncKeyState(i)=-32767) then
begin
Memo1.Text:=Memo1.Text + Chr(i);
Esci:=TRUE;
end;
Inc(i);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
memo1.Clear;
Timer1.Interval:=10;
end;
end.