How to get current modifier states with FireMonkey on OSX?

后端 未结 2 1910
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-13 11:05

With Delphi for Windows, I usually use this code:

function isCtrlDown : Boolean;
var
  ksCurrent : TKeyboardState;
begin
  GetKeyboardState(         


        
2条回答
  •  遥遥无期
    2021-01-13 11:37

    Based on this answer you could try this:

    function isCtrlDown : Boolean; 
    begin
        Result := NSControlKeyMask and TNSEvent.OCClass.modifierFlags = NSControlKeyMask;
    end;
    

提交回复
热议问题