Registriert seit: 22. Mär 2005
Ort: Dingolfing
4.129 Beiträge
Turbo Delphi für Win32
|
Re: Was gibts für Möglichkeiten die Tastatur abzufragen?
15. Jul 2006, 17:50
Delphi-Quellcode:
implementation
{$R *.DFM}
var i:Integer;
keys:array[0..127] of Boolean;
procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
if timer1.enabled = false then begin
form1.width:=screen.width;
form1.height:=screen.height;
form1.position:=poscreencenter;
timer1.enabled:=true;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
for i:=0 to high(keys) do keys[i]:=GetAsyncKeyState(i)=low(SmallInt);
if keys[VK_DOWN] then form1.canvas.Pixels[100,100]:=clred;
end;
end.
So gehts.
Manuel Eberl „The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.“
- Terry Pratchett
|