【发布时间】:2021-12-22 02:57:11
【问题描述】:
我将 Delphi 11 Alexandria 中的 TApplicationEvents.OnShortCut 事件与 Windows 10 中的 Delphi VCL 应用程序一起使用,例如:
procedure TformMain.ApplicationEvents1ShortCut(var Msg: TWMKey; var Handled: Boolean);
begin
CodeSite.Send('TformMain.ApplicationEvents1ShortCut: Msg.CharCode', Msg.CharCode);
end;
不幸的是,即使没有按下修饰键也会触发此事件,例如单独使用“V”键或“B”键。当没有按下修饰键时如何退出此事件处理程序,例如:
procedure TformMain.ApplicationEvents1ShortCut(var Msg: TWMKey; var Handled: Boolean);
begin
if NoModifierKeyPressed then EXIT;
...
end;
【问题讨论】:
标签: delphi keyboard-shortcuts delphi-11-alexandria