def METHOD_NAME(self, index):
    """Either select or deselect an item"""
    modifiers = QApplication.keyboardModifiers()
    ctrl_is_active = modifiers & Qt.KeyboardModifier.ControlModifier
    shift_is_active = modifiers & Qt.KeyboardModifier.ShiftModifier
    if ctrl_is_active:
        item = self._objects_model.getItem(index)
        node = item["node"]
        if Selection.isSelected(node):
            Selection.remove(node)
        else:
            Selection.add(node)
    elif shift_is_active:
        polarity = 1 if index + 1 > self._last_selected_index else -1
        for i in range(self._last_selected_index, index + polarity, polarity):
            item = self._objects_model.getItem(i)
            node = item["node"]
            Selection.add(node)
    else:
        # Single select
        item = self._objects_model.getItem(index)
        node = item["node"]
        build_plate_number = node.callDecoration("getBuildPlateNumber")
        if build_plate_number is not None and build_plate_number != -1:
            self.setActiveBuildPlate(build_plate_number)
        Selection.clear()
        Selection.add(node)
    self._last_selected_index = index