]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiSelectionManager.cpp
Allow Ctrl+Enter in GuiCitation even if the citation is already there
[lyx.git] / src / frontends / qt4 / GuiSelectionManager.cpp
index 5523495d4f05931444318ebc3ff4222722f2023f..eeba9372f0ef73d4205863e7ed0399884722fed1 100644 (file)
@@ -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;