code: def keyPressEvent(self, keyEvent: QtGui.QKeyEvent):
          
          undoObj = UndoInsert(self, keyEvent.text())
          self.qteUndoStack.push(undoObj)
docs: Undo safe wrapper for the native ``keyPressEvent`` method.
  
          |Args|
  
          * ``keyEvent`` (**QKeyEvent**): the key event to process.
  
          |Returns|
  
          **None**
  
          |Raises|
  
          * **QtmacsArgumentError** if at least one argument has an invalid type.