unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Shape1: TShape;
    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
   if Shape1.Shape=stCircle then Shape1.Shape:=stRectangle
   else Shape1.Shape:=stCircle;
   Form1.ActiveControl:=nil;
end;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  case Key of
  vk_Right: Shape1.Left:=Shape1.Left+10; //strzałka w prawo
  vk_Left:  Shape1.Left:=Shape1.Left-10; //strzałka w lewo
  vk_Up:    Shape1.Top:=Shape1.Top-10;   //strzałka w górę
  vk_Down:  Shape1.Top:=Shape1.Top+10;   //strzałka w dół
  end;
end;

end.
