Ignore Enter key press in book list if modifier is also pressed

This commit is contained in:
Kovid Goyal 2017-11-17 21:34:19 +05:30
parent a19bc736e9
commit b5e6ca7c0e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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()