I have TAction with ShortCut key set to BkSp (backspace). I'm trying implementing Back button like in web browser so I need TAction is called in any control except Edit controls (TMemo, TEdit etc.).
All works as expected, but Backspace key is not sent to Edit controls (so user can't delete char).
OnExecute look's like:
if (Screen.ActiveControl is TCustomMemo) or (Screen.ActiveControl is TCustomEdit) then exit;
DoBack;
Any idea to past BkSp key trought TAction to edit control (fo all platforms Win,Mac,Linux)?
Solution is simple, based on Andreas Rejbrand comment and same as in Delphi.
On OnUpdate for action:
procedure TForm1.aBackUpdate(Sender: TObject);
begin
aBack.Enabled := not (Screen.ActiveControl is TCustomEdit);
end;
And OnExecute for action:
procedure TForm1.aBackExecute(Sender: TObject);
begin
DoBack;
end;