Incorrect disable Esc key

TeeGrid VCL / FMX for Embarcadero RAD Studio, Delphi, C++ Builder and Lazarus Free Pascal.
Post Reply
REH Outsourcing
Newbie
Newbie
Posts: 25
Joined: Tue Mar 13, 2018 12:00 am

Incorrect disable Esc key

Post by REH Outsourcing » Wed Jul 04, 2018 11:41 am

Delphi version: Seattle
TTeeGrid version: VCL & FMX Registered version-1.05
Multidevice Application (FMX)
Platform: WIN32

Hello,

The Key variable should not always be assigned to 0, in any case, if you want to solve a problem with a specific platform, you should enclose it in the corresponding define pe:

Code: Select all

procedure TTeeGrid.KeyDown(var Key: Word; var KeyChar: WideChar; Shift: TShiftState);
var tmp : TKeyState;
begin
  inherited;

  tmp.KeyChar:=KeyChar;
  tmp.Key:=Key;

  tmp.Shift:=Shift;
  tmp.Event:=TGridKeyEvent.Down;

  FGrid.Key(tmp);

  {$IFDEF MACOS32}
  Key:=0; // <-- disable "beep" on Mac OSX
  {$ENDIF}
end;
The correct thing, as a general rule, is not to manipulate the key pressed, unless there is a weight ratio that justifies it.

Regards.

Marc
Site Admin
Site Admin
Posts: 1271
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Incorrect disable Esc key

Post by Marc » Thu Jul 05, 2018 8:17 am

Hello,

Change made.

Regards,
Marc

REH Outsourcing
Newbie
Newbie
Posts: 25
Joined: Tue Mar 13, 2018 12:00 am

Re: Incorrect disable Esc key

Post by REH Outsourcing » Thu Jul 05, 2018 8:47 am

Thanks Marc.

Post Reply