From a0ce37147cffa39b1a5c8859eb001dd2194b22a1 Mon Sep 17 00:00:00 2001 From: Guillaume Munch Date: Thu, 2 Mar 2017 22:27:38 +0100 Subject: [PATCH] Allow Ctrl+Enter in GuiCitation even if the citation is already there --- src/frontends/qt4/GuiSelectionManager.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt4/GuiSelectionManager.cpp b/src/frontends/qt4/GuiSelectionManager.cpp index 5523495d4f..eeba9372f0 100644 --- a/src/frontends/qt4/GuiSelectionManager.cpp +++ b/src/frontends/qt4/GuiSelectionManager.cpp @@ -390,15 +390,16 @@ bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event) // This is designed to work both with the main enter key // and the one on the numeric keypad. if (keyPressed == Qt::Key_Enter || keyPressed == Qt::Key_Return) { - if (addPB->isEnabled()) { - if (!keyModifiers) { + if (!keyModifiers || + keyModifiers == Qt::ControlModifier || + keyModifiers == Qt::KeypadModifier || + keyModifiers == (Qt::ControlModifier + | Qt::KeypadModifier)) { + if (addPB->isEnabled()) { addPB_clicked(); - } else if (keyModifiers == Qt::ControlModifier || - keyModifiers == Qt::KeypadModifier || - keyModifiers == (Qt::ControlModifier | Qt::KeypadModifier)) { - addPB_clicked(); - okHook(); //signal } + if (keyModifiers) + okHook(); //signal } event->accept(); return true; -- 2.39.2