code: def isDeleteKeyEvent(self, keyEvent):
          
          return self._start is not None and \
                 (keyEvent.matches(QKeySequence.Delete) or \
                  (keyEvent.key() == Qt.Key_Backspace and keyEvent.modifiers() == Qt.NoModifier))
docs: Check if key event should be handled as Delete command