Lazarus

Programming => Widgetset => Cocoa => Topic started by: AL on March 10, 2020, 03:16:56 am

Title: [SOLVED] Is form onKeyDown implemented in Cocoa
Post by: AL on March 10, 2020, 03:16:56 am
I have the following code that works in Windows but not in Cocoa

procedure TMainForm.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState  );
begin
   If Key = VK_Space then StartBtn.click ;
end;                                                   

The event does not seem to be called in Cocoa.  Should I use something different?
Title: Re: Is form onKeyDown implemented in Cocoa
Post by: skalogryz on March 10, 2020, 03:41:13 am
works fine here (lazarus 2.1.0).
try to set Form.KeyPreview to true.
Title: Re: Is form onKeyDown implemented in Cocoa
Post by: AL on March 10, 2020, 03:22:10 pm
That did it! Thank you.  Problem Solved
TinyPortal © 2005-2018