r24003 by jghali - Move ScribusMainWindow::keyPressEvent() code to CanvasMode

scribus-commit scribus-commit at lists.scribus.net
Mon Aug 31 23:50:06 UTC 2020


Author: jghali
Date: Mon Aug 31 23:50:06 2020
New Revision: 24003

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24003
Log:
Move ScribusMainWindow::keyPressEvent() code to CanvasMode

ScribusMainWindow::keyPressEvent() cannot be removed tho and ScribusMainWindow::keyReleaseEvent() has also to be restored. In some situations it indeed appears that key events go through ScribusMainWindow instead of ScribusView's eventFilter(). ScribusMainWindow's keyPressEvent() and keyReleaseEvent() are hence modified to redirect key events directly to active canvas mode.

Modified:
    trunk/Scribus/scribus/canvasgesture_cellselect.h
    trunk/Scribus/scribus/canvasgesture_columnresize.h
    trunk/Scribus/scribus/canvasgesture_rowresize.h
    trunk/Scribus/scribus/canvasgesture_rulermove.h
    trunk/Scribus/scribus/canvasgesture_tableresize.h
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/canvasmode.h
    trunk/Scribus/scribus/canvasmode_copyproperties.cpp
    trunk/Scribus/scribus/canvasmode_copyproperties.h
    trunk/Scribus/scribus/canvasmode_create.cpp
    trunk/Scribus/scribus/canvasmode_create.h
    trunk/Scribus/scribus/canvasmode_drawbezier.cpp
    trunk/Scribus/scribus/canvasmode_drawbezier.h
    trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
    trunk/Scribus/scribus/canvasmode_drawcalligraphic.h
    trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
    trunk/Scribus/scribus/canvasmode_drawfreehand.h
    trunk/Scribus/scribus/canvasmode_edit.h
    trunk/Scribus/scribus/canvasmode_editarc.cpp
    trunk/Scribus/scribus/canvasmode_editarc.h
    trunk/Scribus/scribus/canvasmode_editgradient.cpp
    trunk/Scribus/scribus/canvasmode_editgradient.h
    trunk/Scribus/scribus/canvasmode_editmeshgradient.h
    trunk/Scribus/scribus/canvasmode_editmeshpatch.h
    trunk/Scribus/scribus/canvasmode_editpolygon.cpp
    trunk/Scribus/scribus/canvasmode_editpolygon.h
    trunk/Scribus/scribus/canvasmode_editspiral.cpp
    trunk/Scribus/scribus/canvasmode_editspiral.h
    trunk/Scribus/scribus/canvasmode_edittable.h
    trunk/Scribus/scribus/canvasmode_editweldpoint.h
    trunk/Scribus/scribus/canvasmode_eyedropper.cpp
    trunk/Scribus/scribus/canvasmode_eyedropper.h
    trunk/Scribus/scribus/canvasmode_framelinks.cpp
    trunk/Scribus/scribus/canvasmode_framelinks.h
    trunk/Scribus/scribus/canvasmode_imageimport.h
    trunk/Scribus/scribus/canvasmode_magnifier.cpp
    trunk/Scribus/scribus/canvasmode_magnifier.h
    trunk/Scribus/scribus/canvasmode_measurements.cpp
    trunk/Scribus/scribus/canvasmode_measurements.h
    trunk/Scribus/scribus/canvasmode_nodeedit.h
    trunk/Scribus/scribus/canvasmode_normal.h
    trunk/Scribus/scribus/canvasmode_objimport.cpp
    trunk/Scribus/scribus/canvasmode_objimport.h
    trunk/Scribus/scribus/canvasmode_panning.cpp
    trunk/Scribus/scribus/canvasmode_panning.h
    trunk/Scribus/scribus/canvasmode_rotate.h
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scribusview.h

Modified: trunk/Scribus/scribus/canvasgesture_cellselect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasgesture_cellselect.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_cellselect.h	(original)
+++ trunk/Scribus/scribus/canvasgesture_cellselect.h	Mon Aug 31 23:50:06 2020
@@ -42,7 +42,6 @@
 	void mousePressEvent(QMouseEvent* event) override;
 	void mouseReleaseEvent(QMouseEvent* event) override;
 	void mouseMoveEvent(QMouseEvent* event) override;
-	bool handleKeyEvents() const override { return true; }
 	void drawControls(QPainter* p) override;
 
 	/// Sets up this gesture to select cells in @a table, starting with @a cell.

Modified: trunk/Scribus/scribus/canvasgesture_columnresize.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasgesture_columnresize.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_columnresize.h	(original)
+++ trunk/Scribus/scribus/canvasgesture_columnresize.h	Mon Aug 31 23:50:06 2020
@@ -38,7 +38,6 @@
 	void keyReleaseEvent(QKeyEvent* event) override;
 	void mouseReleaseEvent(QMouseEvent* event) override;
 	void mouseMoveEvent(QMouseEvent* event) override;
-	bool handleKeyEvents() const override { return true; }
 	void drawControls(QPainter* p) override;
 
 	/// Sets up this column resize gesture to resize @a column in @a table.

Modified: trunk/Scribus/scribus/canvasgesture_rowresize.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasgesture_rowresize.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rowresize.h	(original)
+++ trunk/Scribus/scribus/canvasgesture_rowresize.h	Mon Aug 31 23:50:06 2020
@@ -38,7 +38,6 @@
 	void keyReleaseEvent(QKeyEvent* event) override;
 	void mouseReleaseEvent(QMouseEvent* event) override;
 	void mouseMoveEvent(QMouseEvent* event) override;
-	bool handleKeyEvents() const override { return true; }
 	void drawControls(QPainter* p) override;
 
 	/// Sets up this row resize gesture to resize @a row in @a table.

Modified: trunk/Scribus/scribus/canvasgesture_rulermove.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasgesture_rulermove.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rulermove.h	(original)
+++ trunk/Scribus/scribus/canvasgesture_rulermove.h	Mon Aug 31 23:50:06 2020
@@ -61,7 +61,6 @@
 		void drawControls(QPainter* p) override;
 		void activate(bool) override;
 		void deactivate(bool) override;
-		bool handleKeyEvents() const override { return true; }
 		void keyPressEvent(QKeyEvent* event) override;
 		void mouseReleaseEvent(QMouseEvent *m) override;
 		void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasgesture_tableresize.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasgesture_tableresize.h
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_tableresize.h	(original)
+++ trunk/Scribus/scribus/canvasgesture_tableresize.h	Mon Aug 31 23:50:06 2020
@@ -37,7 +37,6 @@
 	void keyPressEvent(QKeyEvent* event) override;
 	void mouseReleaseEvent(QMouseEvent* event) override;
 	void mouseMoveEvent(QMouseEvent* event) override;
-	bool handleKeyEvents() const override { return true; }
 	void drawControls(QPainter* p) override;
 
 	/// Sets up this table resize gesture to resize @a table.

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode.cpp	Mon Aug 31 23:50:06 2020
@@ -885,6 +885,206 @@
 	p->restore();
 }
 
+void CanvasMode::commonkeyPressEvent_Default(QKeyEvent *e)
+{
+	int kk = e->key();
+	Qt::KeyboardModifiers buttonModifiers = e->modifiers();
+	ScribusMainWindow* mainWindow = m_view->m_ScMW;
+
+	PrefsManager& prefsManager = PrefsManager::instance();
+	QMap<QString, QPointer<ScrAction> >& scrActions(mainWindow->scrActions);
+
+	if ((m_doc->appMode == modeMagnifier) && (kk == Qt::Key_Shift))
+	{
+		m_view->setCursor(IconManager::instance().loadCursor("lupezm.png"));
+		return;
+	}
+
+	if (m_keyRepeat)
+		return;
+	m_keyRepeat = true;
+
+	//User presses escape and we have a doc open, and we have an item selected
+	if (kk == Qt::Key_Escape)
+	{
+		m_keyRepeat = false;
+		PageItem *currItem;
+		if (!m_doc->m_Selection->isEmpty())
+		{
+			currItem = m_doc->m_Selection->itemAt(0);
+			switch (m_doc->appMode)
+			{
+				case modeNormal:
+				case modeEditClip:
+					currItem->Sizing = false;
+					if (m_doc->SubMode != -1)
+					{
+						m_view->deselectItems(false);
+						m_doc->Items->removeOne(currItem);
+					}
+					else
+						m_view->deselectItems(false);
+					m_view->cancelGroupTransaction();
+					break;
+				case modeEdit:
+					m_view->cancelGroupTransaction();
+					break;
+				case modeCopyProperties:
+				case modeEditGradientVectors:
+				case modeEditMeshGradient:
+				case modeLinkFrames:
+				case modeUnlinkFrames:
+				case modeRotation:
+					m_view->deselectItems(false);
+					/* fall through */
+				case modeEditWeldPoint:
+				case modeEyeDropper:
+				case modeImportObject:
+				case modeImportImage:
+				case modePanning:
+					m_view->requestMode(modeNormal);
+					break;
+				case modeDrawBezierLine:
+					break;
+				default:
+					if (currItem->Sizing)
+					{
+						m_view->deselectItems(false);
+						m_doc->Items->removeOne(currItem);
+					}
+					break;
+			}
+		}
+		m_doc->DragP = false;
+		m_doc->leaveDrag = false;
+		m_view->stopAllDrags();
+		m_doc->SubMode = -1;
+		m_doc->ElemToLink = nullptr;
+		mainWindow->slotSelect();
+		if (m_doc->m_Selection->isEmpty())
+			mainWindow->HaveNewSel();
+		prefsManager.appPrefs.uiPrefs.stickyTools = false;
+		scrActions["stickyTools"]->setChecked(false);
+		return;
+	}
+
+	/**If we have a doc and we are not changing the page or zoom level in the status bar */
+	if ((!m_view->m_ScMW->zoomSpinBox->hasFocus()) && (!m_view->m_ScMW->pageSelector->hasFocus()))
+	{
+		//Show our context menu
+		if (mainWindow->actionManager->compareKeySeqToShortcut(kk, buttonModifiers, "viewShowContextMenu"))
+		{
+			ContextMenu* cmen=nullptr;
+			if (m_doc->m_Selection->isEmpty())
+			{
+				//CB We should be able to get this calculated by the canvas.... it is already in m_canvas->globalToCanvas(m->globalPos());
+				QPoint p(QCursor::pos() - mainWindow->mapToGlobal(QPoint(0,0)));
+				FPoint fp(p.x() / m_view->scale() + m_doc->minCanvasCoordinate.x(),
+				p.y() / m_view->scale() + m_doc->minCanvasCoordinate.y());
+				cmen = new ContextMenu(mainWindow, m_doc, fp.x(), fp.y());
+			}
+			else
+				cmen = new ContextMenu(*(m_doc->m_Selection), mainWindow, m_doc);
+			if (cmen)
+			{
+				mainWindow->setUndoMode(true);
+				cmen->exec(QCursor::pos());
+				mainWindow->setUndoMode(false);
+			}
+			delete cmen;
+		}
+
+
+		/**
+		 * With no item selected we can:
+		 * - With space, get into panning mode (modePanning)
+		 * - With PageUp, scroll up
+		 * - With PageDown, scroll down
+		 * - With Tab, change active document windowActivated
+		 */
+
+		if ((m_doc->appMode != modeEdit) && (m_doc->m_Selection->isEmpty()))
+		{
+			int pg;
+			int wheelVal = prefsManager.mouseWheelJump();
+			if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+				wheelVal = qMax(qRound(wheelVal / 10.0), 1);
+			switch (kk)
+			{
+			case Qt::Key_Space:
+				m_keyRepeat = false;
+				if (m_doc->appMode == modePanning)
+					m_view->requestMode(modeNormal);
+				else
+					m_view->requestMode(modePanning);
+				return;
+				break;
+			case Qt::Key_PageUp:
+				if (m_doc->masterPageMode() || m_doc->symbolEditMode() || m_doc->inlineEditMode())
+					m_view->scrollBy(0, -prefsManager.mouseWheelJump());
+				else
+				{
+					pg = m_doc->currentPageNumber();
+					if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+						pg--;
+					else
+						pg -= m_doc->pageSets()[m_doc->pagePositioning()].Columns;
+					if (pg > -1)
+						m_view->GotoPage(pg);
+				}
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_PageDown:
+				if (m_doc->masterPageMode() || m_doc->symbolEditMode() || m_doc->inlineEditMode())
+					m_view->scrollBy(0, prefsManager.mouseWheelJump());
+				else
+				{
+					pg = m_doc->currentPageNumber();
+					if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
+						pg++;
+					else
+						pg += m_doc->pageSets()[m_doc->pagePositioning()].Columns;
+					if (pg < static_cast<int>(m_doc->Pages->count()))
+						m_view->GotoPage(pg);
+				}
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_Left:
+				m_view->scrollBy(-wheelVal, 0);
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_Right:
+				m_view->scrollBy(wheelVal, 0);
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_Up:
+				m_view->scrollBy(0, -wheelVal);
+				m_keyRepeat = false;
+				return;
+				break;
+			case Qt::Key_Down:
+				m_view->scrollBy(0, wheelVal);
+				m_keyRepeat = false;
+				return;
+				break;
+			}
+		}
+	}
+	switch (kk)
+	{
+		case Qt::Key_Left:
+		case Qt::Key_Right:
+		case Qt::Key_Up:
+		case Qt::Key_Down:
+			m_arrowKeyDown = true;
+	}
+	m_keyRepeat = false;
+}
+
 void CanvasMode::commonkeyPressEvent_NormalNodeEdit(QKeyEvent *e)
 {
 	int kk = e->key();
@@ -943,7 +1143,7 @@
 		//Show our context menu
 		if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, e->modifiers(), "viewShowContextMenu"))
 		{
-			ContextMenu* cmen=nullptr;
+			ContextMenu* cmen = nullptr;
 			m_view->setCursor(QCursor(Qt::ArrowCursor));
 			if (m_doc->m_Selection->isEmpty())
 			{

Modified: trunk/Scribus/scribus/canvasmode.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode.h	(original)
+++ trunk/Scribus/scribus/canvasmode.h	Mon Aug 31 23:50:06 2020
@@ -112,7 +112,11 @@
 	virtual void keyReleaseEvent(QKeyEvent *e) {}
 	virtual void inputMethodEvent(QInputMethodEvent *e) {}
 
-	virtual bool handleKeyEvents() const { return false; }
+	/**
+	 * @brief Returns true if an arrow key is pressed down.
+	 * @return true if an arrow key is pressed down otherwise returns false
+	 */
+	bool arrowKeyDown() const { return m_arrowKeyDown; }
 
 	/**
 		Sets appropriate values for this canvas mode
@@ -150,8 +154,6 @@
 	virtual CanvasMode* delegate() { return nullptr; }
 	ScribusView* view() const { return m_view; }
 	~CanvasMode() override;
-	void commonkeyPressEvent_NormalNodeEdit(QKeyEvent *e);
-	void commonkeyReleaseEvent(QKeyEvent *e);
 
 protected:
 	ScribusView* const m_view;
@@ -169,7 +171,10 @@
 	/// Draws the text cursor for @a textframe, offset by @a offset.
 	void commonDrawTextCursor(QPainter* p, PageItem_TextFrame* textframe, const QPointF& offset);
 
-	
+	void commonkeyPressEvent_Default(QKeyEvent *e);
+	void commonkeyPressEvent_NormalNodeEdit(QKeyEvent *e);
+	void commonkeyReleaseEvent(QKeyEvent *e);
+
 private:
 	QMap<QString,QPen> m_pen;
 	QMap<QString,QBrush> m_brush;

Modified: trunk/Scribus/scribus/canvasmode_copyproperties.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_copyproperties.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_copyproperties.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_copyproperties.cpp	Mon Aug 31 23:50:06 2020
@@ -92,6 +92,16 @@
 //	qDebug() << "CanvasMode_CopyProperties::deactivate" << forGesture;
 	m_view->setRedrawMarkerShown(false);
 	CanvasMode::deactivate(forGesture);
+}
+
+void CanvasMode_CopyProperties::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CanvasMode_CopyProperties::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
 }
 
 void CanvasMode_CopyProperties::mouseDoubleClickEvent(QMouseEvent *m)
@@ -101,7 +111,6 @@
 	m_canvas->resetRenderMode();
 //	m_view->stopDragTimer();
 }
-
 
 void CanvasMode_CopyProperties::mouseMoveEvent(QMouseEvent *m)
 {

Modified: trunk/Scribus/scribus/canvasmode_copyproperties.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_copyproperties.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_copyproperties.h	(original)
+++ trunk/Scribus/scribus/canvasmode_copyproperties.h	Mon Aug 31 23:50:06 2020
@@ -37,6 +37,8 @@
 
 		void activate(bool) override;
 		void deactivate(bool) override ;
+		void keyPressEvent(QKeyEvent *e) override;
+		void keyReleaseEvent(QKeyEvent *e) override;
 		void mouseDoubleClickEvent(QMouseEvent *m) override ;
 		void mouseReleaseEvent(QMouseEvent *m) override ;
 		void mouseMoveEvent(QMouseEvent *m) override ;

Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp	Mon Aug 31 23:50:06 2020
@@ -223,6 +223,16 @@
 	CanvasMode::deactivate(forGesture);
 }
 
+void CreateMode::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CreateMode::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
+
 void CreateMode::mouseDoubleClickEvent(QMouseEvent *m)
 {
 	m->accept();

Modified: trunk/Scribus/scribus/canvasmode_create.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_create.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.h	(original)
+++ trunk/Scribus/scribus/canvasmode_create.h	Mon Aug 31 23:50:06 2020
@@ -42,7 +42,9 @@
 	void leaveEvent(QEvent *e) override;
 	
 	void activate(bool) override;
-	void deactivate(bool) override;
+	void deactivate(bool) override;
+	void keyPressEvent(QKeyEvent *e) override;
+	void keyReleaseEvent(QKeyEvent *e) override;
 	void mouseDoubleClickEvent(QMouseEvent *m) override;
 	void mouseReleaseEvent(QMouseEvent *m) override;
 	void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_drawbezier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_drawbezier.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawbezier.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_drawbezier.cpp	Mon Aug 31 23:50:06 2020
@@ -54,14 +54,9 @@
 #include "util.h"
 #include "util_math.h"
 
-
-
-
-
 BezierMode::BezierMode(ScribusView* view) : CanvasMode(view) 
 {
 }
-
 
 void BezierMode::drawControls(QPainter* p) 
 {
@@ -106,11 +101,9 @@
 	}
 }
 
-
 void BezierMode::leaveEvent(QEvent *e)
 {
 }
-
 
 void BezierMode::activate(bool fromGesture)
 {
@@ -184,6 +177,16 @@
 			targetName = m_doc->Pages->at(currItem->OwnPage)->getUName();
 		undoTrans.commit(targetName, currItem->getUPixmap(), Um::Create + " " + currItem->getUName(),  "", Um::ICreate);
 	}
+}
+
+void BezierMode::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void BezierMode::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
 }
 
 void BezierMode::mouseDoubleClickEvent(QMouseEvent *m)

Modified: trunk/Scribus/scribus/canvasmode_drawbezier.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_drawbezier.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawbezier.h	(original)
+++ trunk/Scribus/scribus/canvasmode_drawbezier.h	Mon Aug 31 23:50:06 2020
@@ -40,6 +40,8 @@
 
 		void activate(bool) override;
 		void deactivate(bool) override;
+		void keyPressEvent(QKeyEvent *e) override;
+		void keyReleaseEvent(QKeyEvent *e) override;
 		void mouseDoubleClickEvent(QMouseEvent *m) override;
 		void mouseReleaseEvent(QMouseEvent *m) override;
 		void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp	Mon Aug 31 23:50:06 2020
@@ -71,7 +71,6 @@
 {
 }
 
-
 void CalligraphicMode::activate(bool fromGesture)
 {
 	CanvasMode::activate(fromGesture);
@@ -85,6 +84,16 @@
 {
 	m_view->setRedrawMarkerShown(false);
 	CanvasMode::deactivate(forGesture);
+}
+
+void CalligraphicMode::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CalligraphicMode::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
 }
 
 void CalligraphicMode::mouseDoubleClickEvent(QMouseEvent *m)
@@ -94,7 +103,6 @@
 	m_canvas->resetRenderMode();
 	mousePressEvent(m);
 }
-
 
 void CalligraphicMode::mouseMoveEvent(QMouseEvent *m)
 {

Modified: trunk/Scribus/scribus/canvasmode_drawcalligraphic.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_drawcalligraphic.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawcalligraphic.h	(original)
+++ trunk/Scribus/scribus/canvasmode_drawcalligraphic.h	Mon Aug 31 23:50:06 2020
@@ -40,6 +40,8 @@
 
 		void activate(bool) override;
 		void deactivate(bool) override;
+		void keyPressEvent(QKeyEvent *e) override;
+		void keyReleaseEvent(QKeyEvent *e) override;
 		void mouseDoubleClickEvent(QMouseEvent *m) override;
 		void mouseReleaseEvent(QMouseEvent *m) override;
 		void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawfreehand.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_drawfreehand.cpp	Mon Aug 31 23:50:06 2020
@@ -82,6 +82,16 @@
 	CanvasMode::deactivate(forGesture);
 }
 
+void FreehandMode::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void FreehandMode::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
+
 void FreehandMode::mouseDoubleClickEvent(QMouseEvent *m)
 {
 	m->accept();
@@ -89,7 +99,6 @@
 	m_canvas->resetRenderMode();
 	mousePressEvent(m);
 }
-
 
 void FreehandMode::mouseMoveEvent(QMouseEvent *m)
 {

Modified: trunk/Scribus/scribus/canvasmode_drawfreehand.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_drawfreehand.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawfreehand.h	(original)
+++ trunk/Scribus/scribus/canvasmode_drawfreehand.h	Mon Aug 31 23:50:06 2020
@@ -40,6 +40,8 @@
 
 		void activate(bool) override;
 		void deactivate(bool) override;
+		void keyPressEvent(QKeyEvent *e) override;
+		void keyReleaseEvent(QKeyEvent *e) override;
 		void mouseDoubleClickEvent(QMouseEvent *m) override;
 		void mouseReleaseEvent(QMouseEvent *m) override;
 		void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_edit.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_edit.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_edit.h	(original)
+++ trunk/Scribus/scribus/canvasmode_edit.h	Mon Aug 31 23:50:06 2020
@@ -51,7 +51,6 @@
 	void mouseMoveEvent(QMouseEvent *m) override;
 	void mousePressEvent(QMouseEvent *m) override;
 	
-	bool handleKeyEvents() const override { return true; }
 	void keyPressEvent(QKeyEvent *e) override;
 
 	void drawControls(QPainter* p) override;

Modified: trunk/Scribus/scribus/canvasmode_editarc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editarc.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_editarc.cpp	Mon Aug 31 23:50:06 2020
@@ -297,6 +297,16 @@
 //	QTransform itemMatrix = currItem->getTransform();
 //	m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-currItem->width() / 2.0, -currItem->height() / 2.0, currItem->width(), currItem->height()));
 }
+
+void CanvasMode_EditArc::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CanvasMode_EditArc::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
 
 void CanvasMode_EditArc::mouseDoubleClickEvent(QMouseEvent *m)
 {
@@ -305,7 +315,6 @@
 	m_canvas->resetRenderMode();
 	m_view->requestMode(modeNormal);
 }
-
 
 void CanvasMode_EditArc::mouseMoveEvent(QMouseEvent *m)
 {

Modified: trunk/Scribus/scribus/canvasmode_editarc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editarc.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.h	(original)
+++ trunk/Scribus/scribus/canvasmode_editarc.h	Mon Aug 31 23:50:06 2020
@@ -50,6 +50,8 @@
 	
 	void activate(bool) override;
 	void deactivate(bool) override;
+	void keyPressEvent(QKeyEvent *e) override;
+	void keyReleaseEvent(QKeyEvent *e) override;
 	void mouseDoubleClickEvent(QMouseEvent *m) override;
 	void mouseReleaseEvent(QMouseEvent *m) override;
 	void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_editgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editgradient.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_editgradient.cpp	Mon Aug 31 23:50:06 2020
@@ -268,6 +268,16 @@
 	CanvasMode::deactivate(forGesture);
 }
 
+void CanvasMode_EditGradient::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CanvasMode_EditGradient::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
+
 void CanvasMode_EditGradient::mouseDoubleClickEvent(QMouseEvent *m)
 {
 	m->accept();
@@ -303,7 +313,6 @@
 		}
 	}
 }
-
 
 void CanvasMode_EditGradient::mouseMoveEvent(QMouseEvent *m)
 {

Modified: trunk/Scribus/scribus/canvasmode_editgradient.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editgradient.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editgradient.h	(original)
+++ trunk/Scribus/scribus/canvasmode_editgradient.h	Mon Aug 31 23:50:06 2020
@@ -43,6 +43,8 @@
 
 		void activate(bool) override;
 		void deactivate(bool) override;
+		void keyPressEvent(QKeyEvent *e) override;
+		void keyReleaseEvent(QKeyEvent *e) override;
 		void mouseDoubleClickEvent(QMouseEvent *m) override;
 		void mouseReleaseEvent(QMouseEvent *m) override;
 		void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_editmeshgradient.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editmeshgradient.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshgradient.h	(original)
+++ trunk/Scribus/scribus/canvasmode_editmeshgradient.h	Mon Aug 31 23:50:06 2020
@@ -49,12 +49,11 @@
 
 		void activate(bool) override;
 		void deactivate(bool) override;
+		void keyPressEvent(QKeyEvent *e) override;
 		void mouseDoubleClickEvent(QMouseEvent *m) override;
 		void mouseReleaseEvent(QMouseEvent *m) override;
 		void mouseMoveEvent(QMouseEvent *m) override;
 		void mousePressEvent(QMouseEvent *m) override;
-		void keyPressEvent(QKeyEvent *e) override;
-		bool handleKeyEvents() const override { return true; }
 		void drawControls(QPainter* p) override;
 		void drawControlsMeshGradient(QPainter* psx, PageItem* currItem);
 

Modified: trunk/Scribus/scribus/canvasmode_editmeshpatch.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editmeshpatch.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshpatch.h	(original)
+++ trunk/Scribus/scribus/canvasmode_editmeshpatch.h	Mon Aug 31 23:50:06 2020
@@ -50,12 +50,11 @@
 
 		void activate(bool) override;
 		void deactivate(bool) override;
+		void keyPressEvent(QKeyEvent *e) override;
 		void mouseDoubleClickEvent(QMouseEvent *m) override;
 		void mouseReleaseEvent(QMouseEvent *m) override;
 		void mouseMoveEvent(QMouseEvent *m) override;
 		void mousePressEvent(QMouseEvent *m) override;
-		void keyPressEvent(QKeyEvent *e) override;
-		bool handleKeyEvents() const override { return true; }
 		void drawControls(QPainter* p) override;
 		void drawControlsMeshPoint(QPainter* psx, const MeshPoint& mp, bool isSelected);
 		void drawControlsMeshPatch(QPainter* psx, PageItem* currItem);

Modified: trunk/Scribus/scribus/canvasmode_editpolygon.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editpolygon.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editpolygon.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_editpolygon.cpp	Mon Aug 31 23:50:06 2020
@@ -316,6 +316,16 @@
 	return ret;
 }
 
+void CanvasMode_EditPolygon::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CanvasMode_EditPolygon::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
+
 void CanvasMode_EditPolygon::mouseDoubleClickEvent(QMouseEvent *m)
 {
 	m->accept();

Modified: trunk/Scribus/scribus/canvasmode_editpolygon.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editpolygon.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editpolygon.h	(original)
+++ trunk/Scribus/scribus/canvasmode_editpolygon.h	Mon Aug 31 23:50:06 2020
@@ -50,6 +50,8 @@
 	
 	void activate(bool) override;
 	void deactivate(bool) override;
+	void keyPressEvent(QKeyEvent *e) override;
+	void keyReleaseEvent(QKeyEvent *e) override;
 	void mouseDoubleClickEvent(QMouseEvent *m) override;
 	void mouseReleaseEvent(QMouseEvent *m) override;
 	void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_editspiral.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editspiral.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editspiral.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_editspiral.cpp	Mon Aug 31 23:50:06 2020
@@ -261,6 +261,16 @@
 	m_doc->regionsChanged()->update(itemMatrix.mapRect(QRectF(0, 0, currItem->width(), currItem->height())).adjusted(-5, -5, 10, 10));
 }
 
+void CanvasMode_EditSpiral::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CanvasMode_EditSpiral::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
+
 void CanvasMode_EditSpiral::mouseDoubleClickEvent(QMouseEvent *m)
 {
 	m->accept();
@@ -268,7 +278,6 @@
 	m_canvas->resetRenderMode();
 	m_view->requestMode(modeNormal);
 }
-
 
 void CanvasMode_EditSpiral::mouseMoveEvent(QMouseEvent *m)
 {

Modified: trunk/Scribus/scribus/canvasmode_editspiral.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editspiral.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editspiral.h	(original)
+++ trunk/Scribus/scribus/canvasmode_editspiral.h	Mon Aug 31 23:50:06 2020
@@ -50,6 +50,8 @@
 	
 	void activate(bool) override;
 	void deactivate(bool) override;
+	void keyPressEvent(QKeyEvent *e) override;
+	void keyReleaseEvent(QKeyEvent *e) override;
 	void mouseDoubleClickEvent(QMouseEvent *m) override;
 	void mouseReleaseEvent(QMouseEvent *m) override;
 	void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_edittable.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_edittable.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_edittable.h	(original)
+++ trunk/Scribus/scribus/canvasmode_edittable.h	Mon Aug 31 23:50:06 2020
@@ -41,7 +41,6 @@
 
 	void activate(bool fromGesture) override;
 	void deactivate(bool forGesture) override;
-	bool handleKeyEvents() const override { return true; }
 	void keyPressEvent(QKeyEvent* event) override;
 	void mouseMoveEvent(QMouseEvent* event) override;
 	void mousePressEvent(QMouseEvent* event) override;

Modified: trunk/Scribus/scribus/canvasmode_editweldpoint.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_editweldpoint.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editweldpoint.h	(original)
+++ trunk/Scribus/scribus/canvasmode_editweldpoint.h	Mon Aug 31 23:50:06 2020
@@ -55,7 +55,6 @@
 	void mouseMoveEvent(QMouseEvent *m) override;
 	void mousePressEvent(QMouseEvent *m) override;
 	void keyPressEvent(QKeyEvent *e) override;
-	bool handleKeyEvents() const override { return true; }
 	void drawControls(QPainter* p) override;
 	void drawControlsWeldPoint(QPainter* psx, PageItem* currItem);
 

Modified: trunk/Scribus/scribus/canvasmode_eyedropper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_eyedropper.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_eyedropper.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_eyedropper.cpp	Mon Aug 31 23:50:06 2020
@@ -106,6 +106,16 @@
 	CanvasMode::deactivate(forGesture);
 }
 
+void CanvasMode_EyeDropper::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CanvasMode_EyeDropper::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
+
 void CanvasMode_EyeDropper::mouseDoubleClickEvent(QMouseEvent *m)
 {
 	m->accept();
@@ -113,7 +123,6 @@
 	m_canvas->resetRenderMode();
 //	m_view->stopDragTimer();
 }
-
 
 void CanvasMode_EyeDropper::mouseMoveEvent(QMouseEvent *m)
 {

Modified: trunk/Scribus/scribus/canvasmode_eyedropper.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_eyedropper.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_eyedropper.h	(original)
+++ trunk/Scribus/scribus/canvasmode_eyedropper.h	Mon Aug 31 23:50:06 2020
@@ -36,7 +36,9 @@
 	void leaveEvent(QEvent *) override;
 	
 	void activate(bool) override;
-	void deactivate(bool) override;
+	void deactivate(bool) override;
+	void keyPressEvent(QKeyEvent *e) override;
+	void keyReleaseEvent(QKeyEvent *e) override;
 	void mouseDoubleClickEvent(QMouseEvent *m) override;
 	void mouseReleaseEvent(QMouseEvent *m) override;
 	void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_framelinks.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_framelinks.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_framelinks.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_framelinks.cpp	Mon Aug 31 23:50:06 2020
@@ -128,6 +128,16 @@
 //	qDebug() << "CanvasMode_FrameLinks::deactivate" << forGesture;
 	m_view->setRedrawMarkerShown(false);
 	CanvasMode::deactivate(forGesture);
+}
+
+void CanvasMode_FrameLinks::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CanvasMode_FrameLinks::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
 }
 
 void CanvasMode_FrameLinks::mouseDoubleClickEvent(QMouseEvent *m)

Modified: trunk/Scribus/scribus/canvasmode_framelinks.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_framelinks.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_framelinks.h	(original)
+++ trunk/Scribus/scribus/canvasmode_framelinks.h	Mon Aug 31 23:50:06 2020
@@ -48,6 +48,8 @@
 	
 	void activate(bool) override;
 	void deactivate(bool) override;
+	void keyPressEvent(QKeyEvent *e) override;
+	void keyReleaseEvent(QKeyEvent *e) override;
 	void mouseDoubleClickEvent(QMouseEvent *m) override;
 	void mouseReleaseEvent(QMouseEvent *m) override;
 	void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_imageimport.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_imageimport.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_imageimport.h	(original)
+++ trunk/Scribus/scribus/canvasmode_imageimport.h	Mon Aug 31 23:50:06 2020
@@ -43,7 +43,6 @@
 	void activate(bool) override;
 	void deactivate(bool) override;
 	void keyPressEvent(QKeyEvent *e) override;
-	bool handleKeyEvents() const override { return true; }
 	void mouseDoubleClickEvent(QMouseEvent *m) override;
 	void mouseReleaseEvent(QMouseEvent *m) override;
 	void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_magnifier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_magnifier.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_magnifier.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_magnifier.cpp	Mon Aug 31 23:50:06 2020
@@ -95,6 +95,16 @@
 	CanvasMode::deactivate(forGesture);
 }
 
+void CanvasMode_Magnifier::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CanvasMode_Magnifier::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
+
 void CanvasMode_Magnifier::mouseDoubleClickEvent(QMouseEvent *m)
 {
 	m->accept();

Modified: trunk/Scribus/scribus/canvasmode_magnifier.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_magnifier.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_magnifier.h	(original)
+++ trunk/Scribus/scribus/canvasmode_magnifier.h	Mon Aug 31 23:50:06 2020
@@ -45,6 +45,8 @@
 
 		void activate(bool) override;
 		void deactivate(bool) override;
+		void keyPressEvent(QKeyEvent *e) override;
+		void keyReleaseEvent(QKeyEvent *e) override;
 		void mouseDoubleClickEvent(QMouseEvent *m) override;
 		void mouseReleaseEvent(QMouseEvent *m) override;
 		void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_measurements.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_measurements.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_measurements.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_measurements.cpp	Mon Aug 31 23:50:06 2020
@@ -73,6 +73,16 @@
 	p->restore();
 }
 
+void MeasurementsMode::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void MeasurementsMode::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
+
 void MeasurementsMode::mouseReleaseEvent(QMouseEvent *m)
 {
 	if (m_active)

Modified: trunk/Scribus/scribus/canvasmode_measurements.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_measurements.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_measurements.h	(original)
+++ trunk/Scribus/scribus/canvasmode_measurements.h	Mon Aug 31 23:50:06 2020
@@ -42,7 +42,9 @@
 	void leaveEvent(QEvent *) override;
 	
 	void activate(bool) override;
-	void deactivate(bool) override;
+	void deactivate(bool) override;
+	void keyPressEvent(QKeyEvent *e) override;
+	void keyReleaseEvent(QKeyEvent *e) override;
 	void mouseReleaseEvent(QMouseEvent *m) override;
 	void mouseMoveEvent(QMouseEvent *m) override;
 	void mousePressEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_nodeedit.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_nodeedit.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.h	(original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.h	Mon Aug 31 23:50:06 2020
@@ -49,11 +49,9 @@
 		void keyPressEvent(QKeyEvent *e) override;
 		void keyReleaseEvent(QKeyEvent *e) override;
 
-		bool handleKeyEvents() const override { return true; }
-
 		/**
-		Draws the controls for this mode
-	 */
+		 * Draws the controls for this mode
+		 */
 		void drawControls(QPainter* p) override;
 
 	private:

Modified: trunk/Scribus/scribus/canvasmode_normal.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_normal.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.h	(original)
+++ trunk/Scribus/scribus/canvasmode_normal.h	Mon Aug 31 23:50:06 2020
@@ -47,16 +47,15 @@
 	
 	void activate(bool) override;
 	void deactivate(bool) override;
+
+	void keyPressEvent(QKeyEvent *e) override;
+	void keyReleaseEvent(QKeyEvent *e) override;
+
 	void mouseDoubleClickEvent(QMouseEvent *m) override;
 	void mouseReleaseEvent(QMouseEvent *m) override;
 	void mouseMoveEvent(QMouseEvent *m) override;
 	void mousePressEvent(QMouseEvent *m) override;
 	void drawControls(QPainter* p) override;
-
-	void keyPressEvent(QKeyEvent *e) override;
-	void keyReleaseEvent(QKeyEvent *e) override;
-
-	bool handleKeyEvents() const override { return true; }
 
 private:
 	const unsigned SELECT_IN_GROUP { Qt::AltModifier }; // Qt::MetaModifier;

Modified: trunk/Scribus/scribus/canvasmode_objimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_objimport.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_objimport.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_objimport.cpp	Mon Aug 31 23:50:06 2020
@@ -112,6 +112,16 @@
 	m_view->setRedrawMarkerShown(false);
 
 	CanvasMode::deactivate(forGesture);
+}
+
+void CanvasMode_ObjImport::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CanvasMode_ObjImport::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
 }
 
 void CanvasMode_ObjImport::mouseDoubleClickEvent(QMouseEvent *m)

Modified: trunk/Scribus/scribus/canvasmode_objimport.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_objimport.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_objimport.h	(original)
+++ trunk/Scribus/scribus/canvasmode_objimport.h	Mon Aug 31 23:50:06 2020
@@ -50,6 +50,8 @@
 	
 	void activate(bool) override;
 	void deactivate(bool) override;
+	void keyPressEvent(QKeyEvent *e) override;
+	void keyReleaseEvent(QKeyEvent *e) override;
 	void mouseDoubleClickEvent(QMouseEvent *m) override;
 	void mouseReleaseEvent(QMouseEvent *m) override;
 	void mouseMoveEvent(QMouseEvent *m) override;

Modified: trunk/Scribus/scribus/canvasmode_panning.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_panning.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_panning.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_panning.cpp	Mon Aug 31 23:50:06 2020
@@ -54,7 +54,6 @@
 {
 }
 
-
 void CanvasMode_Panning::activate(bool fromGesture)
 {
 	CanvasMode::activate(fromGesture);
@@ -79,6 +78,16 @@
 	CanvasMode::deactivate(forGesture);
 }
 
+void CanvasMode_Panning::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_Default(e);
+}
+
+void CanvasMode_Panning::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
+
 void CanvasMode_Panning::mouseDoubleClickEvent(QMouseEvent *m)
 {
 	m->accept();

Modified: trunk/Scribus/scribus/canvasmode_panning.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_panning.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_panning.h	(original)
+++ trunk/Scribus/scribus/canvasmode_panning.h	Mon Aug 31 23:50:06 2020
@@ -42,6 +42,8 @@
 
 		void activate(bool) override;
 		void deactivate(bool) override;
+		void keyPressEvent(QKeyEvent *e) override;
+		void keyReleaseEvent(QKeyEvent *e) override;
 		void mouseDoubleClickEvent(QMouseEvent *m) override;
 		void mousePressEvent(QMouseEvent *m) override;
 		void drawControls(QPainter* p) override;

Modified: trunk/Scribus/scribus/canvasmode_rotate.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/canvasmode_rotate.h
==============================================================================
--- trunk/Scribus/scribus/canvasmode_rotate.h	(original)
+++ trunk/Scribus/scribus/canvasmode_rotate.h	Mon Aug 31 23:50:06 2020
@@ -44,14 +44,13 @@
 		void drawControls(QPainter* p) override;
 		void activate(bool) override;
 		void deactivate(bool) override;
+		
+		void keyReleaseEvent(QKeyEvent *e) override;
+		void keyPressEvent(QKeyEvent *e) override;
 
 		void mousePressEvent(QMouseEvent *m) override;
 		void mouseReleaseEvent(QMouseEvent *m) override;
 		void mouseMoveEvent(QMouseEvent *m) override;
-		void keyReleaseEvent(QKeyEvent *e) override;
-		void keyPressEvent(QKeyEvent *e) override;
-
-		bool handleKeyEvents() const override { return true; }
 
 	private:
 		inline bool GetItem(PageItem** pi);

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Mon Aug 31 23:50:06 2020
@@ -42,6 +42,7 @@
 
 #include "appmodes.h"
 #include "canvas.h"
+#include "canvasmode.h"
 #include "cmsettings.h"
 #include "colorblind.h"
 #include "desaxe/saxXML.h"
@@ -4529,7 +4530,7 @@
 bool PageItem::shouldCheck()
 {
 	return ((!m_Doc->view()->mousePressed()) &&
-			(!ScCore->primaryMainWindow()->arrowKeyDown()) &&
+			(!m_Doc->view()->canvasMode()->arrowKeyDown()) &&
 			(!ScCore->primaryMainWindow()->propertiesPalette->userActionOn()));
 }
 

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Mon Aug 31 23:50:06 2020
@@ -621,8 +621,8 @@
 	PDef.Pname.clear();
 	PDef.Dname.clear();
 	PDef.Command.clear();
-	m_keyrep = false;
-	m_arrowKeyDown = false;
+	//m_keyrep = false;
+	//m_arrowKeyDown = false;
 	ClipB = QApplication::clipboard();
 	for (int i=0; i<PAL_MAX ; ++i)
 		m_palettesStatus[i] = false;
@@ -1758,248 +1758,32 @@
 //AV -> CanvasMode
 void ScribusMainWindow::keyPressEvent(QKeyEvent *k)
 {
-	int kk = k->key();
-	if (HaveDoc)
-	{
-		if ((doc->appMode == modeMagnifier) && (kk == Qt::Key_Shift))
-		{
-			view->setCursor(IconManager::instance().loadCursor("lupezm.png"));
-			return;
-		}
-	}
-	if (m_keyrep)
-		return;
-	m_keyrep = true;
-
-	//User presses escape and we have a doc open, and we have an item selected
-	if ((kk == Qt::Key_Escape) && (HaveDoc))
-	{
-		m_keyrep = false;
-		PageItem *currItem;
-		if (!doc->m_Selection->isEmpty())
-		{
-			currItem = doc->m_Selection->itemAt(0);
-			switch (doc->appMode)
-			{
-				case modeNormal:
-				case modeEditClip:
-					currItem->Sizing = false;
-					if (doc->SubMode != -1)
-					{
-						view->deselectItems(false);
-						doc->Items->removeOne(currItem);
-					}
-					else
-						view->deselectItems(false);
-					view->cancelGroupTransaction();
-					break;
-				case modeEdit:
-					view->cancelGroupTransaction();
-					break;
-				case modeCopyProperties:
-				case modeEditGradientVectors:
-				case modeEditMeshGradient:
-				case modeLinkFrames:
-				case modeUnlinkFrames:
-				case modeRotation:
-					view->deselectItems(false);
-					/* fall through */
-				case modeEditWeldPoint:
-				case modeEyeDropper:
-				case modeImportObject:
-				case modeImportImage:
-				case modePanning:
-					view->requestMode(modeNormal);
-					break;
-				case modeDrawBezierLine:
-					break;
-				default:
-					if (currItem->Sizing)
-					{
-						view->deselectItems(false);
-						doc->Items->removeOne(currItem);
-					}
-					break;
-			}
-		}
-		doc->DragP = false;
-		doc->leaveDrag = false;
-		view->stopAllDrags();
-		doc->SubMode = -1;
-		doc->ElemToLink = nullptr;
-		slotSelect();
-		if (doc->m_Selection->isEmpty())
-			HaveNewSel();
-		m_prefsManager.appPrefs.uiPrefs.stickyTools = false;
-		scrActions["stickyTools"]->setChecked(false);
-		return;
-	}
-	Qt::KeyboardModifiers buttonModifiers = k->modifiers();
-	/**If we have a doc and we are not changing the page or zoom level in the status bar */
-	if ((HaveDoc) && (!zoomSpinBox->hasFocus()) && (!pageSelector->hasFocus()))
-	{
-		//Show our context menu
-		if (actionManager->compareKeySeqToShortcut(kk, buttonModifiers, "viewShowContextMenu"))
-		{
-			ContextMenu* cmen=nullptr;
-			if (doc->m_Selection->isEmpty())
-			{
-				//CB We should be able to get this calculated by the canvas.... it is already in m_canvas->globalToCanvas(m->globalPos());
-				QPoint p(QCursor::pos() - mapToGlobal(QPoint(0,0)));
-				FPoint fp(p.x() / view->scale() + doc->minCanvasCoordinate.x(),
-				p.y() / view->scale() + doc->minCanvasCoordinate.y());
-				cmen = new ContextMenu(this, doc, fp.x(), fp.y());
-			}
-			else
-				cmen = new ContextMenu(*(doc->m_Selection), this, doc);
-			if (cmen)
-			{
-				setUndoMode(true);
-				cmen->exec(QCursor::pos());
-				setUndoMode(false);
-			}
-			delete cmen;
-		}
-
-
-		/**
-		 * With no item selected we can:
-		 * - With space, get into panning mode (modePanning)
-		 * - With PageUp, scroll up
-		 * - With PageDown, scroll down
-		 * - With Tab, change active document windowActivated
-		 */
-
-		if ((doc->appMode != modeEdit) && (doc->m_Selection->isEmpty()))
-		{
-			int pg;
-			int wheelVal = m_prefsManager.mouseWheelJump();
-			if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-				wheelVal = qMax(qRound(wheelVal / 10.0), 1);
-			switch (kk)
-			{
-			case Qt::Key_Space:
-				m_keyrep = false;
-				if (doc->appMode == modePanning)
-					view->requestMode(modeNormal);
-				else
-					view->requestMode(modePanning);
-				return;
-				break;
-			case Qt::Key_PageUp:
-				if (doc->masterPageMode() || doc->symbolEditMode() || doc->inlineEditMode())
-					view->scrollBy(0, -m_prefsManager.mouseWheelJump());
-				else
-				{
-					pg = doc->currentPageNumber();
-					if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-						pg--;
-					else
-						pg -= doc->pageSets()[doc->pagePositioning()].Columns;
-					if (pg > -1)
-						view->GotoPage(pg);
-				}
-				m_keyrep = false;
-				return;
-				break;
-			case Qt::Key_PageDown:
-				if (doc->masterPageMode() || doc->symbolEditMode() || doc->inlineEditMode())
-					view->scrollBy(0, m_prefsManager.mouseWheelJump());
-				else
-				{
-					pg = doc->currentPageNumber();
-					if ((buttonModifiers & Qt::ShiftModifier) && !(buttonModifiers & Qt::ControlModifier) && !(buttonModifiers & Qt::AltModifier))
-						pg++;
-					else
-						pg += doc->pageSets()[doc->pagePositioning()].Columns;
-					if (pg < static_cast<int>(doc->Pages->count()))
-						view->GotoPage(pg);
-				}
-				m_keyrep = false;
-				return;
-				break;
-			case Qt::Key_Left:
-				view->scrollBy(-wheelVal, 0);
-				m_keyrep = false;
-				return;
-				break;
-			case Qt::Key_Right:
-				view->scrollBy(wheelVal, 0);
-				m_keyrep = false;
-				return;
-				break;
-			case Qt::Key_Up:
-				view->scrollBy(0, -wheelVal);
-				m_keyrep = false;
-				return;
-				break;
-			case Qt::Key_Down:
-				view->scrollBy(0, wheelVal);
-				m_keyrep = false;
-				return;
-				break;
-			}
-		}
-	}
-	switch (kk)
-	{
-		case Qt::Key_Left:
-		case Qt::Key_Right:
-		case Qt::Key_Up:
-		case Qt::Key_Down:
-			m_arrowKeyDown = true;
-	}
-	m_keyrep = false;
-}
-/*
+	if (HaveDoc && view)
+	{
+		view->canvasMode()->keyPressEvent(k);
+		return;
+	}
+
+	QMainWindow::keyPressEvent(k);
+}
+
 void ScribusMainWindow::keyReleaseEvent(QKeyEvent *k)
 {
-	//Exit out of panning mode if Control is release while the right mouse button is pressed
-	if (HaveDoc)
-	{
-		if ((doc->appMode == modePanning) && (k->key() == Qt::Key_Control) && (QApplication::mouseButtons() & Qt::RightButton))
-			view->requestMode(modeNormal);
-
-		if ((doc->appMode == modeMagnifier) && (k->key() == Qt::Key_Shift))
-			view->setCursor(IconManager::instance().loadCursor("lupez.png"));
-	}
-	if (k->isAutoRepeat() || !m_arrowKeyDown)
-		return;
-	switch (k->key())
-	{
-		case Qt::Key_Left:
-		case Qt::Key_Right:
-		case Qt::Key_Up:
-		case Qt::Key_Down:
-			m_arrowKeyDown = false;
-			if ((HaveDoc) && (!zoomSpinBox->hasFocus()) && (!pageSelector->hasFocus()))
-			{
-				int docSelectionCount = doc->m_Selection->count();
-				if ((docSelectionCount != 0) && (doc->appMode == modeEditClip) && (doc->nodeEdit.hasNodeSelected()))
-				{
-					PageItem *currItem = doc->m_Selection->itemAt(0);
-					double xposOrig = currItem->xPos();
-					double yposOrig = currItem->yPos();
-					doc->adjustItemSize(currItem);
-					if (!doc->nodeEdit.isContourLine())
-						currItem->ContourLine.translate(xposOrig - currItem->xPos(),yposOrig - currItem->yPos());
-					currItem->update();
-				}
-				for (int i = 0; i < docSelectionCount; ++i)
-					doc->m_Selection->itemAt(i)->checkChanges(true);
-				if (docSelectionCount > 1 && view->groupTransactionStarted())
-					view->endGroupTransaction();
-			}
-			break;
-	}
-}
-*/
+	if (HaveDoc && view)
+	{
+		view->canvasMode()->keyReleaseEvent(k);
+		return;
+	}
+
+	QMainWindow::keyReleaseEvent(k);
+}
+
 void ScribusMainWindow::changeEvent(QEvent *e)
 {
 	if (e->type() == QEvent::LanguageChange)
 		languageChange();
 	else
-		QWidget::changeEvent(e);
+		QMainWindow::changeEvent(e);
 }
 
 void ScribusMainWindow::closeEvent(QCloseEvent *ce)
@@ -2017,7 +1801,7 @@
 	disconnect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(newActWin(QMdiSubWindow *)));
 	if (!windows.isEmpty())
 	{
-		int windowCount=windows.count();
+		int windowCount = windows.count();
 		for ( int i = 0; i < windowCount; ++i )
 		{
 			tw = dynamic_cast<ScribusWin *>(windows.at(i));
@@ -2099,11 +1883,12 @@
 // SLOT IMPLEMENTATION
 /////////////////////////////////////////////////////////////////////
 
-
+/*
 bool ScribusMainWindow::arrowKeyDown()
 {
 	return m_arrowKeyDown;
 }
+*/
 
 QStringList ScribusMainWindow::findRecoverableFile()
 {
@@ -5747,7 +5532,7 @@
 {
 	if (!doc)
 		return;
-	m_keyrep=false;
+	//m_keyrep=false;
 	if (m_guidesStatus[GS_ALL])
 	{
 		m_guidesStatus[GS_ALL] = false;
@@ -6093,7 +5878,7 @@
 
 void ScribusMainWindow::setAppModeByToggle(bool isOn, int newMode)
 {
-	m_keyrep=false;
+	//m_keyrep=false;
 
 	if (newMode==modeDrawLatex && !m_prefsManager.renderFrameConfigured())
 	{

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h	(original)
+++ trunk/Scribus/scribus/scribus.h	Mon Aug 31 23:50:06 2020
@@ -155,7 +155,7 @@
 	void changeEvent(QEvent *e);
 	void closeEvent(QCloseEvent *ce);
 	void keyPressEvent(QKeyEvent *k);
-	//void keyReleaseEvent(QKeyEvent *k);
+	void keyReleaseEvent(QKeyEvent *k);
 	void inputMethodEvent (QInputMethodEvent *event);
 	QVariant inputMethodQuery ( Qt::InputMethodQuery query ) const ;
 	void requestUpdate(int);
@@ -184,7 +184,8 @@
 	 * @brief Returns true if an arrow key is pressed down.
 	 * @return true if an arrow key is pressed down otherwise returns false
 	 */
-	bool arrowKeyDown();
+	//bool arrowKeyDown();
+
 	/**
 	 * @brief Returns true if application is in object specific undo mode, other wise returns false.
 	 * @return true if application is in object specific undo mode, other wise returns false
@@ -638,9 +639,9 @@
 	bool m_palettesStatus[13];
 	bool m_guidesStatus[13];
 
-	bool m_keyrep;
+	//bool m_keyrep;
 	/** @brief Tells if an arrow key is pressed down */
-	bool m_arrowKeyDown;
+	//bool m_arrowKeyDown;
 	/** @brief tells the undo mode */
 	bool m_objectSpecificUndo;
 

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp	(original)
+++ trunk/Scribus/scribus/scribusview.cpp	Mon Aug 31 23:50:06 2020
@@ -3263,31 +3263,31 @@
 
 void ScribusView::keyPressEvent(QKeyEvent *k)
 {
-	if (m_canvasMode && m_canvasMode->handleKeyEvents())
+	if (m_canvasMode)
 		m_canvasMode->keyPressEvent(k);
-	else
-		m_ScMW->keyPressEvent(k);
-}
-/*
+}
+
 void ScribusView::keyReleaseEvent(QKeyEvent *k)
 {
-	m_ScMW->keyReleaseEvent(k);
-}
-*/
-
-void ScribusView::inputMethodEvent ( QInputMethodEvent * event )
+	if (m_canvasMode)
+		m_canvasMode->keyReleaseEvent(k);
+}
+
+void ScribusView::inputMethodEvent(QInputMethodEvent * event)
 {
 	//qDebug() << "IME" << event->commitString() << event->preeditString() << "attributes:" << event->attributes().count();
 	// #9682 : Avoid parameter type ambiguity in QKeyEvent constructor with Qt3Support enabled Qt builds
 	Qt::KeyboardModifiers modifiers = Qt::NoModifier;
-	for (int i = 0; i < event->commitString().length(); ++i)
-	{
-		QKeyEvent ev( QEvent::KeyPress, 0, modifiers, event->commitString().mid(i,1));
+
+	const QString& commitString = event->commitString();
+	for (int i = 0; i < commitString.length(); ++i)
+	{
+		QKeyEvent ev(QEvent::KeyPress, 0, modifiers, commitString.mid(i, 1));
 		keyPressEvent(&ev);
 	}
 }
 
-QVariant ScribusView::inputMethodQuery ( Qt::InputMethodQuery query ) const
+QVariant ScribusView::inputMethodQuery(Qt::InputMethodQuery query) const
 {
 	//	qDebug() << "IMQ" << query;
 	return QVariant();
@@ -3302,7 +3302,7 @@
 	}
 	else
 	{
-		int dX = 0,dY = 0;
+		int dX = 0, dY = 0;
 		int moveBy = (w->delta() < 0) ? Prefs->uiPrefs.wheelJump : -Prefs->uiPrefs.wheelJump;
 		if ((w->orientation() != Qt::Vertical) || ( w->modifiers() == Qt::ShiftModifier ))
 			dX = moveBy;
@@ -3480,19 +3480,13 @@
 	if (event->type() == QEvent::KeyPress)
 	{
 		auto* k = dynamic_cast<QKeyEvent*> (event);
-		if (m_canvasMode->handleKeyEvents())
-			m_canvasMode->keyPressEvent(k);
-		else
-			m_ScMW->keyPressEvent(k);
+		m_canvasMode->keyPressEvent(k);
 		return true;
 	}
 	if (event->type() == QEvent::KeyRelease)
 	{
 		auto* m = dynamic_cast<QKeyEvent*> (event);
-		if (m_canvasMode->handleKeyEvents())
-			m_canvasMode->keyReleaseEvent(m);
-		else
-			m_canvasMode->commonkeyReleaseEvent(m);
+		m_canvasMode->keyReleaseEvent(m);
 		return true;
 	}
 	if (obj == widget() && event->type() == QEvent::DragEnter)

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24003&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h	(original)
+++ trunk/Scribus/scribus/scribusview.h	Mon Aug 31 23:50:06 2020
@@ -317,7 +317,7 @@
 	virtual void changeEvent(QEvent *e);
 	void nativeGestureEvent(QNativeGestureEvent *e);
 	void keyPressEvent(QKeyEvent *k);
-//	void keyReleaseEvent(QKeyEvent *k);
+	void keyReleaseEvent(QKeyEvent *k);
 	void inputMethodEvent(QInputMethodEvent * event);
 	QVariant inputMethodQuery(Qt::InputMethodQuery query) const ;
 	




More information about the scribus-commit mailing list