From 7db99cce6b5d8dcde669e187959a3049a99e2da3 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 2 Nov 2019 12:07:11 +1300 Subject: [PATCH 1/3] Fix Cmd-clone entities on Mac --- .../create/entitySelectionTool/entitySelectionTool.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/system/create/entitySelectionTool/entitySelectionTool.js b/scripts/system/create/entitySelectionTool/entitySelectionTool.js index 6774c72627..c1b512cb10 100644 --- a/scripts/system/create/entitySelectionTool/entitySelectionTool.js +++ b/scripts/system/create/entitySelectionTool/entitySelectionTool.js @@ -2047,7 +2047,9 @@ SelectionDisplay = (function() { // Duplicate entities if Ctrl is pressed. This will make a // copy of the selected entities and move the _original_ entities, not // the new ones. - if (event.isControl || doDuplicate) { + var isMac = Controller.getValue(Controller.Hardware.Application.PlatformMac); + var isControl = isMac ? event.isMeta : event.isControl; + if (isControl || doDuplicate) { duplicatedEntityIDs = SelectionManager.duplicateSelection(); var ids = []; for (var i = 0; i < duplicatedEntityIDs.length; ++i) { @@ -2273,7 +2275,9 @@ SelectionDisplay = (function() { // Duplicate entities if Ctrl is pressed. This will make a // copy of the selected entities and move the _original_ entities, not // the new ones. - if (event.isControl) { + var isMac = Controller.getValue(Controller.Hardware.Application.PlatformMac); + var isControl = isMac ? event.isMeta : event.isControl; + if (isControl) { duplicatedEntityIDs = SelectionManager.duplicateSelection(); var ids = []; for (var i = 0; i < duplicatedEntityIDs.length; ++i) { From 5fb18566fe331c8223dadfa662b1d02fda3f13d3 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 6 Nov 2019 09:55:16 +1300 Subject: [PATCH 2/3] Use Alt to clone entities on Mac --- .../entitySelectionTool/entitySelectionTool.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/system/create/entitySelectionTool/entitySelectionTool.js b/scripts/system/create/entitySelectionTool/entitySelectionTool.js index c1b512cb10..98f1deb4ad 100644 --- a/scripts/system/create/entitySelectionTool/entitySelectionTool.js +++ b/scripts/system/create/entitySelectionTool/entitySelectionTool.js @@ -2044,12 +2044,11 @@ SelectionDisplay = (function() { Vec3.print(" pickResult.intersection", pickResult.intersection); } - // Duplicate entities if Ctrl is pressed. This will make a - // copy of the selected entities and move the _original_ entities, not - // the new ones. + // Duplicate entities if Ctrl is pressed on Windows or Alt is press on Mac. + // This will make a copy of the selected entities and move the _original_ entities, not the new ones. var isMac = Controller.getValue(Controller.Hardware.Application.PlatformMac); - var isControl = isMac ? event.isMeta : event.isControl; - if (isControl || doDuplicate) { + var isDuplicate = isMac ? event.isAlt : event.isControl; + if (isDuplicate || doDuplicate) { duplicatedEntityIDs = SelectionManager.duplicateSelection(); var ids = []; for (var i = 0; i < duplicatedEntityIDs.length; ++i) { @@ -2272,12 +2271,11 @@ SelectionDisplay = (function() { addHandleTool(overlay, { mode: mode, onBegin: function(event, pickRay, pickResult) { - // Duplicate entities if Ctrl is pressed. This will make a - // copy of the selected entities and move the _original_ entities, not - // the new ones. + // Duplicate entities if Ctrl is pressed on Windows or Alt is pressed on Mac. + // This will make a copy of the selected entities and move the _original_ entities, not the new ones. var isMac = Controller.getValue(Controller.Hardware.Application.PlatformMac); - var isControl = isMac ? event.isMeta : event.isControl; - if (isControl) { + var isDuplicate = isMac ? event.isAlt : event.isControl; + if (isDuplicate) { duplicatedEntityIDs = SelectionManager.duplicateSelection(); var ids = []; for (var i = 0; i < duplicatedEntityIDs.length; ++i) { From 45eda4046642beb22d461b2474cef533814ac3cc Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 13 Nov 2019 10:48:08 +1300 Subject: [PATCH 3/3] Enable Alt action for cloning on Mac --- .../system/create/entitySelectionTool/entitySelectionTool.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/system/create/entitySelectionTool/entitySelectionTool.js b/scripts/system/create/entitySelectionTool/entitySelectionTool.js index 98f1deb4ad..9bab739060 100644 --- a/scripts/system/create/entitySelectionTool/entitySelectionTool.js +++ b/scripts/system/create/entitySelectionTool/entitySelectionTool.js @@ -1118,8 +1118,9 @@ SelectionDisplay = (function() { return false; } - // No action if the Alt key is pressed. - if (event.isAlt) { + // No action if the Alt key is pressed unless on Mac. + var isMac = Controller.getValue(Controller.Hardware.Application.PlatformMac); + if (event.isAlt && !isMac) { return; }