예제 #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()