Page 1 of 1

Incorrect disable Esc key

Posted: Wed Jul 04, 2018 11:41 am
by 18683216
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.

Re: Incorrect disable Esc key

Posted: Thu Jul 05, 2018 8:17 am
by Marc
Hello,

Change made.

Regards,
Marc

Re: Incorrect disable Esc key

Posted: Thu Jul 05, 2018 8:47 am
by 18683216
Thanks Marc.