【发布时间】:2018-10-10 11:41:54
【问题描述】:
我将快捷键设置为 BkSp(退格键)的 TAction。我正在尝试像在网络浏览器中那样实现后退按钮,所以我需要在除编辑控件(TMemo、TEdit 等)之外的任何控件中调用 TAction。
一切按预期工作,但退格键未发送到编辑控件(因此用户无法删除字符)。
OnExecute 看起来像:
if (Screen.ActiveControl is TCustomMemo) or (Screen.ActiveControl is TCustomEdit) then exit;
DoBack;
任何想法通过 BkSp 键 trought TAction 来编辑控件(适用于所有平台 Win、Mac、Linux)?
【问题讨论】:
-
在Delphi for Win32中,你可以试试
procedure TForm1.aBackUpdate(Sender: TObject); begin aBack.Enabled := not (Screen.ActiveControl is TCustomEdit); end; -
@AndreasRejbrand 在 Lazarus 的工作方式相同。谢谢!
标签: pascal lazarus multiplatform