Make group on 'G' work correctly (and not mess up text entry)

This commit is contained in:
Lars Brubaker 2022-05-05 16:21:52 -07:00
parent 614ae5348c
commit c5eab9abb9

View file

@ -271,30 +271,6 @@ namespace MatterHackers.MatterControl
break;
case Keys.G:
if (view3D.Printer == null
|| (view3D.Printer != null && view3D.Printer.ViewState.ViewMode == PartViewMode.Model))
{
var scene = view3D.sceneContext.Scene;
if (scene.SelectedItem != null)
{
if (keyEvent.Shift)
{
scene.UngroupSelection();
}
else if (scene.SelectedItem is SelectionGroupObject3D
&& scene.SelectedItem.Children.Count > 1)
{
var group = new GroupHolesAppliedObject3D();
group.WrapSelectedItemAndSelect(scene);
}
}
}
keyEvent.Handled = true;
keyEvent.SuppressKeyPress = true;
break;
case Keys.Z:
if (keyEvent.Control)
{
@ -619,6 +595,28 @@ namespace MatterHackers.MatterControl
{
switch (keyEvent.KeyChar)
{
case 'g':
case 'G':
if (view3D.Printer == null
|| (view3D.Printer != null && view3D.Printer.ViewState.ViewMode == PartViewMode.Model))
{
var scene = view3D.sceneContext.Scene;
if (scene.SelectedItem != null)
{
if (Keyboard.IsKeyDown(Keys.Shift))
{
scene.UngroupSelection();
}
else if (scene.SelectedItem is SelectionGroupObject3D
&& scene.SelectedItem.Children.Count > 1)
{
var group = new GroupHolesAppliedObject3D();
group.WrapSelectedItemAndSelect(scene);
}
}
}
break;
case 'w':
case 'W':
view3D.ResetView();