docs: def keyPressEvent(self, event):
          """
          Overrides the keyPressEvent to emit the key_pressed signal.
  
          Also takes care of indenting and handling smarter home key.
  
          :param event: QKeyEvent
          """
          if self.isReadOnly():
              return
          initial_state = event.isAccepted()
          event.ignore()
          self.key_pressed.emit(event)
          state = event.isAccepted()
          if not event.isAccepted():
              if event.key() == QtCore.Qt.Key_Tab and event.modifiers() == \
                      QtCore.Qt.NoModifier:
                  self.indent()
                  event.accept()
              elif event.key() == QtCore.Qt.Key_Backtab and \
                      event.modifiers() == QtCore.Qt.NoModifier:
                  self.un_indent()
                  event.accept()
              elif event.key() == QtCore.Qt.Key_Home and \
                      int(event.modifiers()) & QtCore.Qt.ControlModifier == 0:
                  self._do_home_key(
                      event, int(event.modifiers()) & QtCore.Qt.ShiftModifier)
              if not event.isAccepted():
                  event.setAccepted(initial_state)
                  super(CodeEdit, self).keyPressEvent(event)
          new_state = event.isAccepted()
          event.setAccepted(state)
          self.post_key_pressed.emit(event)
          event.setAccepted(new_state)