In KeyDown is the MacOS COMMAND key defined in a TShiftState? I can't figure it out. Any ideas?
In KeyDown is the MacOS COMMAND key defined in a TShiftState? I can't figure it out. Any ideas?it's ssMeta
Not sure on a mac but maybe the GetKeyState in the LCLIntf unit will do it ?
If you know the Virtual key code of the MAC key you can do this during a Keydown event..
If GetKeyState(VK_MACKEY?) < 0 THen its pressed..
Like I said, I don't know what the key code would be...
In KeyDown is the MacOS COMMAND key defined in a TShiftState? I can't figure it out. Any ideas?it's ssMeta
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin if (ssMeta in Shift) then Caption:='Command is held' else Caption :='not a command'; end;
I use this for cross-platform:
// define standard menu command key as ssCmd {$IFDEF DARWIN} ssCmd = ssMeta; // Apple {$ELSE} ssCmd = ssCtrl; // Windows, Linux {$ENDIF}