From e4024b8b057507f6c9125bd4974eaff03fa2ee5f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 10 May 2014 19:05:26 +0530 Subject: [PATCH] Edit Book: Allow putting the editor into replace mode by pressing the Insert key --- src/calibre/gui2/tweak_book/editor/text.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index 24bea37bce..da0ea747f8 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -660,6 +660,10 @@ class TextEdit(PlainTextEdit): if self.replace_possible_unicode_sequence(): ev.accept() return + if ev.key() == Qt.Key_Insert: + self.setOverwriteMode(self.overwriteMode() ^ True) + ev.accept() + return QPlainTextEdit.keyPressEvent(self, ev) if (ev.key() == Qt.Key_Semicolon or ';' in unicode(ev.text())) and tprefs['replace_entities_as_typed'] and self.syntax == 'html': self.replace_possible_entity()