{
This cross-platform example changes a form’s color to aqua 
when the user presses the F1 key, even when a control on the
form has the focus. When the user releases the key, the form
returns to its original color.
} 
var
  FormColor: TColor;
procedure TForm1.FormCreate(Sender: TObject);
begin
  KeyPreview := True;
end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if Key = Key_F1 then
  begin
    FormColor := Form1.Color;
    Form1.Color := clAqua;
  end;
end;
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if Key = Key_F1 then
    Form1.Color := FormColor;
end; 
