Ich möchte ein Metronom erstellen, welches auf Tastendruck einer bestimmten Taste ein oder aus geschaltet werden kann.
Mein Problem damit ist das abschalten.
Code: Alles auswählen
procedure TMetronom.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
Ass:=1;
if key=VK_Down then Ass:=0;
if Ass=1 then
repeat
PlaySound('Pfad', 0, SND_FILENAME or SND_ASYNC);
sleep(300);
if key=VK_Down then Ass:=0;
until Ass=0;
end;
Wie kann ich das Problem beheben??