def METHOD_NAME(self, obj: QObject, evt: QEvent) -> bool:
    if isinstance(evt, QKeyEvent) and evt.type() == QEvent.Type.KeyPress:
        new_row = current_row = self.form.list.currentRow()
        rows_count = self.form.list.count()
        key = evt.key()
        if key == Qt.Key.Key_Up:
            new_row = current_row - 1
        elif key == Qt.Key.Key_Down:
            new_row = current_row + 1
        elif (
            evt.modifiers() & Qt.KeyboardModifier.ControlModifier
            and Qt.Key.Key_1 <= key <= Qt.Key.Key_9
        ):
            row_index = key - Qt.Key.Key_1
            if row_index < rows_count:
                new_row = row_index
        if rows_count:
            new_row %= rows_count  # don't let row index overflow/underflow
        if new_row != current_row:
            self.form.list.setCurrentRow(new_row)
            return True
    return False