You are attempting to trap the key stroke on the form instead of a
specific component.
Set the KeyPreview property to true or in the OnCreate Method as below
Add a FormKeyDown Event to process your requirements
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
Edit1: TEdit;
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (key=ord('1')) and (ssCtrl in Shift) then
begin
Edit1.Text:='Pressed';
{ Add your code here }
Key:=0; // if required
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
KeyPreview:=True;
end;
end.