From 43d2fd2da9e1bbcd51186be5b826f7ae15bb8fa9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 5 Nov 2022 22:56:38 +0100 Subject: [PATCH] Gui/Sketcher: disable geometry deselection when user holds Ctrl or additionally Shift or Alt --- src/Gui/NavigationStyle.cpp | 3 ++- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index 99d8018250..6abef059fc 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -1480,8 +1480,9 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev) if ((curmode == NavigationStyle::SELECTION || curmode == NavigationStyle::IDLE) && !processed) { if (SoMouseButtonEvent::isButtonReleaseEvent(ev, SoMouseButtonEvent::BUTTON1)) { - if (!(QApplication::keyboardModifiers() == Qt::ControlModifier)) + if (!ev->wasCtrlDown()) { Gui::Selection().clearSelection(); + } } } diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index aa492b09c1..c5bc2a18bb 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -891,8 +891,9 @@ 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 unless user hold control. - if (!(QApplication::keyboardModifiers() == Qt::ControlModifier)) + if (!(QApplication::keyboardModifiers() & Qt::ControlModifier)) { Gui::Selection().clearSelection(); + } Mode = STATUS_NONE; return true; case STATUS_SKETCH_UseRubberBand: