Map Ctrl to Cmd for editor copy hotkey.
This commit is contained in:
@@ -88,6 +88,16 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var copypasteButton = widget.GetOrNull<ButtonWidget>("COPYPASTE_BUTTON");
|
||||
if (copypasteButton != null)
|
||||
{
|
||||
// HACK: Replace Ctrl with Cmd on macOS
|
||||
// TODO: Add platform-specific override support to HotkeyManager
|
||||
// and then port the editor hotkeys to this system.
|
||||
var copyPasteKey = copypasteButton.Key.GetValue();
|
||||
if (Platform.CurrentPlatform == PlatformType.OSX && copyPasteKey.Modifiers.HasModifier(Modifiers.Ctrl))
|
||||
{
|
||||
var modified = new Hotkey(copyPasteKey.Key, copyPasteKey.Modifiers & ~Modifiers.Ctrl | Modifiers.Meta);
|
||||
copypasteButton.Key = FieldLoader.GetValue<HotkeyReference>("Key", modified.ToString());
|
||||
}
|
||||
|
||||
copypasteButton.OnClick = () => editorViewport.SetBrush(new EditorCopyPasteBrush(editorViewport, worldRenderer, () => copyFilters));
|
||||
copypasteButton.IsHighlighted = () => editorViewport.CurrentBrush is EditorCopyPasteBrush;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user