OpenToonz - An open-source full-featured 2D animation creation software
C
Disable keyboard shortcuts while dragging vector line (#2914)
Martin van Zijlbf25486844c5
diff --git a/toonz/sources/include/tools/tool.h b/toonz/sources/include/tools/tool.hindex 67647486a..59ee74af8 100644--- a/toonz/sources/include/tools/tool.h+++ b/toonz/sources/include/tools/tool.h@@ -513,6 +513,9 @@ transformation.// Tools.virtual bool isPencilModeActive() { return false; }+ // return true if the tool is busy with a mouse drag operation+ virtual bool isDragging() const { return false; };+void setSelectedFrames(const std::set<TFrameId> &selectedFrames);static const std::set<TFrameId> &getSelectedFrames() {return m_selectedFrames;diff --git a/toonz/sources/tnztools/vectorselectiontool.cpp b/toonz/sources/tnztools/vectorselectiontool.cppindex 114d7a78e..66b46b77c 100644--- a/toonz/sources/tnztools/vectorselectiontool.cpp+++ b/toonz/sources/tnztools/vectorselectiontool.cpp@@ -1990,6 +1990,12 @@ void VectorSelectionTool::onImageChanged() {//-----------------------------------------------------------------------------+bool VectorSelectionTool::isDragging() const {+ return m_enabled && m_leftButtonMousePressed;+}++//-----------------------------------------------------------------------------+void VectorSelectionTool::doOnDeactivate() {m_strokeSelection.selectNone();m_levelSelection.selectNone();diff --git a/toonz/sources/tnztools/vectorselectiontool.h b/toonz/sources/tnztools/vectorselectiontool.hindex 29df53b15..441b307f4 100644--- a/toonz/sources/tnztools/vectorselectiontool.h+++ b/toonz/sources/tnztools/vectorselectiontool.h@@ -338,6 +338,8 @@ protected:return m_cursorId;}+ bool isDragging() const override;+private:class AttachedLevelSelection final : public LevelSelection {StrokeSelection &m_strokeSelection; //!< Selection of strokes to be seen atdiff --git a/toonz/sources/toonz/sceneviewerevents.cpp b/toonz/sources/toonz/sceneviewerevents.cppindex add268068..6539fc680 100644--- a/toonz/sources/toonz/sceneviewerevents.cpp+++ b/toonz/sources/toonz/sceneviewerevents.cpp@@ -1191,6 +1191,12 @@ bool SceneViewer::event(QEvent *e) {e->accept();}+ // Disable keyboard shortcuts while the tool is busy with a mouse drag+ // operation.+ if ( tool->isDragging() ) {+ e->accept();+ }+return true;}if (e->type() == QEvent::KeyRelease) {