From eeddcfd2aa2d1f28748fee08b83a8242774b6d80 Mon Sep 17 00:00:00 2001 From: Paddle Date: Fri, 4 Nov 2022 11:51:54 +0100 Subject: [PATCH] Base: + Sketcher: disable deselection when user holds Ctrl. --- src/Gui/NavigationStyle.cpp | 6 ++++-- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index 74637475aa..99d8018250 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -1479,8 +1479,10 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev) // check for left click without selecting something if ((curmode == NavigationStyle::SELECTION || curmode == NavigationStyle::IDLE) && !processed) { - if (SoMouseButtonEvent::isButtonReleaseEvent(ev,SoMouseButtonEvent::BUTTON1)) - Gui::Selection().clearSelection(); + if (SoMouseButtonEvent::isButtonReleaseEvent(ev, SoMouseButtonEvent::BUTTON1)) { + if (!(QApplication::keyboardModifiers() == Qt::ControlModifier)) + Gui::Selection().clearSelection(); + } } return processed; diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index d8446f3977..2fc948214f 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -889,9 +889,10 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe } Mode = STATUS_NONE; return true; - case STATUS_SKETCH_StartRubberBand: // a single click happened, so clear selection + case STATUS_SKETCH_StartRubberBand: // a single click happened, so clear selection unless user hold control. + if (!(QApplication::keyboardModifiers() == Qt::ControlModifier)) + Gui::Selection().clearSelection(); Mode = STATUS_NONE; - Gui::Selection().clearSelection(); return true; case STATUS_SKETCH_UseRubberBand: doBoxSelection(DoubleClick::prvCursorPos, cursorPos, viewer);