Determining Control/Command Key Cross-Platform

From reading the LD on the Keyboard command, I assume there is no Keyboard.??? boolean that covers both the Control and Command keys depending on whether it’s MacOS or Windows/Linux? (the 2 perform basically the same function - Command on Mac, Control on Win/Linux) so I thought there might be a single Keyboard.??? function?

I’m doing this now:

#If TargetMacOS Then SelectKeyPressed = Keyboard.CommandKey #Else SelectKeyPressed = Keyboard.ControlKey #EndIf

Is that the best way?

or

 SelectKeyPressed = Keyboard.CommandKey OR Keyboard.ControlKey

Try Keyboard.MenuShortcutKey

[quote=466469:@Dave S]or

SelectKeyPressed = Keyboard.CommandKey OR Keyboard.ControlKey [/quote]
Wouldn’t that result in True when the Control key is pressed on a Mac?

That’s an odd name for that Key! I would assume MenuShortcutKey would be the Windows Key on a Windows machine!

Why? Copy is CTRL-C in Windows and CMD-C on macOS. The Windows key typically isn’t used for menus.

Why “Menu” key? The Windows key at least brings up the Start Menu, so that’s more a Menu key than Ctrl. The Ctrl or Command key doesn’t bring up any Menus.
Even the Alt key would be closer to a “Menu” key, since it highlights menu items on Windows.

No matter, just some weird name somebody came up with. Makes no sense, but what ever does?

[quote=466510:@Andy Broughton]Why “Menu” key? The Windows key at least brings up the Start Menu, so that’s more a Menu key than Ctrl. The Ctrl or Command key doesn’t bring up any Menus.
Even the Alt key would be closer to a “Menu” key, since it highlights menu items on Windows.

No matter, just some weird name somebody came up with. Makes no sense, but what ever does?[/quote]
Because it’s the key that you use for nearly every menu shortcut on macOS, Windows and Linux. It’s all about cross platform compatibility. Remember macOS has both a Control key and a Command key. I’d also point out that it’s been this way for a very long time. Predates my time at the company by at least 10 years :slight_smile: