From b5e6ca7c0e68b1665d014deab1e1d0d89ef64853 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 17 Nov 2017 21:34:19 +0530 Subject: [PATCH] Ignore Enter key press in book list if modifier is also pressed --- src/calibre/gui2/library/alternate_views.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/library/alternate_views.py b/src/calibre/gui2/library/alternate_views.py index bea953f8fc..f4d2bb040c 100644 --- a/src/calibre/gui2/library/alternate_views.py +++ b/src/calibre/gui2/library/alternate_views.py @@ -44,6 +44,9 @@ class EncodeError(ValueError): def handle_enter_press(self, ev, special_action=None): if ev.key() in (Qt.Key_Enter, Qt.Key_Return): + mods = ev.modifiers() + if mods & Qt.CTRL or mods & Qt.ALT or mods & Qt.SHIFT or mods & Qt.META: + return if self.state() != self.EditingState and self.hasFocus() and self.currentIndex().isValid(): from calibre.gui2.ui import get_gui ev.ignore()