View Issue Details

IDProjectCategoryView StatusLast Update
0017290ScribusUser Interfacepublic2024-10-16 01:04
ReporterBN_Dev Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86_64OSLinux/macOSOS VersionAll
Product Version1.7.0.svn 
Summary0017290: Plus Minus on Numpad Not Working for Zoom
DescriptionRef: https://forums.scribus.net/index.php/topic,5600.0.html reported by SirMix:
I run Scribus 1.6.1 on Mint 22 and the Plus Minus keys on the numpad are not working in combination with the CTRL-key for zooming in and out.
I can configure the shortcuts in the menu by using the numpad plus/minus keys, but they do not zoom. The CRTL+0 on the numpad works.
Steps To Reproduce1. Go to document canvas
2. Press Ctrl+- (Control and Minus) on primary keyboard [assumes default keyboard shortcuts are set]
3. Observe toolsZoomOut action is invoked
4. Press Ctrl+- (Control and Minus) on numeric keyboard
5. Observe no action is invoked
Additional InformationReason for bug is when the numeric keyboard is used, the keyboard modifier flag Qt::KeypadModifier is set, which is not being matched against the expected shortcut.
Patch removes this flag so the shortcut matching works as expected with the numeric keyboard.
Only tested on KDE/Linux.
TagsNo tags attached.
PatchYes

Activities

BN_Dev

2024-10-16 01:04

reporter  

numpad_shortcuts.patch (1,626 bytes)   
Index: scribus/canvasmode.cpp
===================================================================
--- scribus/canvasmode.cpp	(revision 26312)
+++ scribus/canvasmode.cpp	(working copy)
@@ -1042,7 +1042,7 @@
 void CanvasMode::commonkeyPressEvent_NormalNodeEdit(QKeyEvent *e)
 {
 	int kk = e->key();
-	Qt::KeyboardModifiers buttonModifiers = e->modifiers();
+	Qt::KeyboardModifiers buttonModifiers = e->modifiers() & ~Qt::KeypadModifier;
 	ScribusMainWindow* mainWindow = m_view->m_ScMW;
 	
 	PrefsManager& prefsManager = PrefsManager::instance();
@@ -1082,15 +1082,15 @@
 		scrActions["stickyTools"]->setChecked(false);
 		return;
 	}
-	if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, e->modifiers(), "toolsZoomIn"))
+	if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, buttonModifiers, "toolsZoomIn"))
 		scrActions["toolsZoomIn"]->trigger();
-	if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, e->modifiers(), "toolsZoomOut"))
+	if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, buttonModifiers, "toolsZoomOut"))
 		scrActions["toolsZoomOut"]->trigger();
 	/**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 (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, e->modifiers(), "viewShowContextMenu"))
+		if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, buttonModifiers, "viewShowContextMenu"))
 		{
 			ContextMenu* cmen = nullptr;
 			m_view->setCursor(QCursor(Qt::ArrowCursor));
numpad_shortcuts.patch (1,626 bytes)   

Issue History

Date Modified Username Field Change
2024-10-16 01:04 BN_Dev New Issue
2024-10-16 01:04 BN_Dev File Added: numpad_shortcuts.patch