コード例 #1
0
 def keyPressEvent(self, event):
     if event and self._key_press_rules:
         next_text = self._key_press_rules.getText(event.key())
         if next_text:
             self.insertPlainText(next_text)
             return
     QPlainTextEdit.keyPressEvent(self, event)
コード例 #2
0
ファイル: text.py プロジェクト: amorphous1/calibre
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier:
         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()
コード例 #3
0
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier:
         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()
コード例 #4
0
ファイル: text.py プロジェクト: timpalpant/calibre
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier:
         if self.replace_possible_unicode_sequence():
             ev.accept()
             return
     if ev.key() == Qt.Key_Insert:
         self.setOverwriteMode(self.overwriteMode() ^ True)
         ev.accept()
         return
     if self.snippet_manager.handle_key_press(ev):
         self.completion_popup.hide()
         return
     if self.smarts.handle_key_press(ev, self):
         self.handle_keypress_completion(ev)
         return
     QPlainTextEdit.keyPressEvent(self, ev)
     self.handle_keypress_completion(ev)
コード例 #5
0
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier:
         if self.replace_possible_unicode_sequence():
             ev.accept()
             return
     if ev.key() == Qt.Key_Insert:
         self.setOverwriteMode(self.overwriteMode() ^ True)
         ev.accept()
         return
     if self.snippet_manager.handle_key_press(ev):
         self.completion_popup.hide()
         return
     if self.smarts.handle_key_press(ev, self):
         self.handle_keypress_completion(ev)
         return
     QPlainTextEdit.keyPressEvent(self, ev)
     self.handle_keypress_completion(ev)
コード例 #6
0
ファイル: text.py プロジェクト: silencen/calibre
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier:
         if self.replace_possible_unicode_sequence():
             ev.accept()
             return
     if ev.key() == Qt.Key_Insert:
         self.setOverwriteMode(self.overwriteMode() ^ True)
         ev.accept()
         return
     if isosx and ev.modifiers() == Qt.ControlModifier and re.search(r'[a-zA-Z0-9]+', ev.text()) is not None:
         # For some reason Qt 5 translates Cmd+key into text on OS X
         # https://bugreports.qt-project.org/browse/QTBUG-36281
         ev.setAccepted(False)
         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()
コード例 #7
0
ファイル: text.py プロジェクト: tokot/calibre
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier:
         if self.replace_possible_unicode_sequence():
             ev.accept()
             return
     if ev.key() == Qt.Key_Insert:
         self.setOverwriteMode(self.overwriteMode() ^ True)
         ev.accept()
         return
     if isosx and QT_VERSION < 0x504000 and ev.modifiers() == Qt.ControlModifier and re.search(r'[a-zA-Z0-9]+', ev.text()) is not None:
         # For some reason Qt 5 translates Cmd+key into text on OS X
         # https://bugreports.qt-project.org/browse/QTBUG-36281
         ev.setAccepted(False)
         return
     if self.smarts.handle_key_press(ev, self):
         return
     QPlainTextEdit.keyPressEvent(self, ev)
コード例 #8
0
 def keyPressEvent(self, ev):
     if ev.key() == Qt.Key_X and ev.modifiers() == Qt.AltModifier:
         if self.replace_possible_unicode_sequence():
             ev.accept()
             return
     if ev.key() == Qt.Key_Insert:
         self.setOverwriteMode(self.overwriteMode() ^ True)
         ev.accept()
         return
     if isosx and ev.modifiers() == Qt.ControlModifier and re.search(r'[a-zA-Z0-9]+', ev.text()) is not None:
         # For some reason Qt 5 translates Cmd+key into text on OS X
         # https://bugreports.qt-project.org/browse/QTBUG-36281
         ev.setAccepted(False)
         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()