📅  最后修改于: 2022-03-11 14:54:56.291000             🧑  作者: Mango
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case Key of
VK_UP:
Shape1.Top := Shape1.Top - 10;
VK_DOWN:
Shape1.Top := Shape1.Top + 10;
VK_LEFT:
Shape1.Left := Shape1.Left - 10;
VK_RIGHT:
Shape1.Left := Shape1.Left + 10;
end;
end;