Delphi for Windowsでは、通常、次のコードを使用します。
function isCtrlDown : Boolean;
var
ksCurrent : TKeyboardState;
begin
GetKeyboardState(ksCurrent);
Result := ((ksCurrent[VK_CONTROL] and 128) <> 0);
end;
Mac OSX 上の FireMonkey でこれを実現するにはどうすればよいですか?
これを見つけましたが、FireMonkey/Delphi で管理する方法がわかりません (...):
void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey)
{
UInt32 currentModifiers = GetCurrentKeyModifiers();
shiftKey = currentModifiers & ::shiftKey;
ctrlKey = currentModifiers & ::controlKey;
altKey = currentModifiers & ::optionKey;
metaKey = currentModifiers & ::cmdKey;
}
まだ調査中です...今のところ、このユニットには重要なイベントのものがあります...
unit Macapi.AppKit;