From 1d0e1ce8d75d98fac0a7acdb190d54a525e13cf8 Mon Sep 17 00:00:00 2001 From: john pierson Date: Fri, 21 Jan 2022 14:32:24 -0700 Subject: [PATCH 1/2] Added shift + click to nodes and notes to remove from current group --- src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs b/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs index b41d4916675..3deab517a63 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs @@ -1053,6 +1053,21 @@ private void InitiateDragSequence() if (this.currentState != State.None) throw new InvalidOperationException(); + // add shift click removal of group node or note belongs to + if (Keyboard.IsKeyDown(Key.LeftShift) && !DynamoSelection.Instance.Selection.OfType().Any()) + { + foreach (var model in DynamoSelection.Instance.Selection.OfType()) + { + var parentGroup = owningWorkspace.Annotations + .Where(x => x.AnnotationModel.ContainsModel(model)) + .FirstOrDefault(); + if (parentGroup != null) + { + owningWorkspace.DynamoViewModel.UngroupModelCommand.Execute(null); + } + } + } + SetCurrentState(State.DragSetup); } From cac76d145def5139a915eefd187d16778f17b335 Mon Sep 17 00:00:00 2001 From: tanga Date: Fri, 11 Feb 2022 17:24:37 -0500 Subject: [PATCH 2/2] more comments --- src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs b/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs index 3deab517a63..c173e378a32 100644 --- a/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs +++ b/src/DynamoCoreWpf/ViewModels/Core/StateMachine.cs @@ -613,8 +613,8 @@ internal bool HandleLeftButtonDown(object sender, MouseButtonEventArgs e) var element = sender as IInputElement; mouseDownPos = e.GetPosition(element); - // We'll see if there is any node being clicked on. If so, - // then the state machine should initiate a drag operation. + // Check if there is any Dynamo Element (e.g. node, note, group) being clicked on. If so, + // then the state machine should initiate a drag operation if user keeps dragging the mouse . if (null != GetSelectableFromPoint(mouseDownPos)) { InitiateDragSequence(); @@ -1053,7 +1053,8 @@ private void InitiateDragSequence() if (this.currentState != State.None) throw new InvalidOperationException(); - // add shift click removal of group node or note belongs to + // Before setting the drag state, + // shift + left click triggers removal of group node or note belongs to if (Keyboard.IsKeyDown(Key.LeftShift) && !DynamoSelection.Instance.Selection.OfType().Any()) { foreach (var model in DynamoSelection.Instance.Selection.OfType())