Registriert seit: 15. Nov 2003
Ort: Berlin
946 Beiträge
Delphi 10.2 Tokyo Professional
|
Re: Tastenabfrage
31. Jan 2004, 11:40
Kleiner Anhang, hab ich vergessen
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
Laufe : Boolean;
procedure MachWas;
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.MachWas;
var
I : Integer;
begin
Laufe := True;
I := 0;
while I < 32555 do
begin
Application.ProcessMessages;
Inc(I);
end;
end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if (Key = 32) and not Laufe then MachWas;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Laufe := False;
end;
end.
|
|
Zitat
|