def confirm_box_selection(self):
        """Perform the box selection and needed setups."""
        ### if the smallest dimension of the selection box
        ### is too small, cancel the selecting;
        ###
        ### this will cause the method to stop executing,
        ### by raising an exception indicating the mode
        ### must be changed to the normal 'loaded file'
        ### mode, after doing some clean up;
        ###
        ### check the 'xxx' comment in draw_selection_box()
        ### method to know why we impose this limitation

        if min(self.selection_box.size) < 4:
            self.cancel_box_selection()

        ### get a bitmask and use it to evaluate whether
        ### the shift and ctrl keys are pressed or not

        bitmask = SERVICES_NS.get_pressed_mod_keys()

        shift = bitmask & KMOD_SHIFT
        ctrl = bitmask & KMOD_CTRL

        ### perform box collision selection according
        ### to suitable scenario defined below depending
        ### on the states of modifier keys;
        ###
        ### note that "ctrl and not shift" condition triggers
        ### segment severing (cutting lines between nodes),
        ### so don't use it here;

        ## extend selection with colliding objects

        if shift and not ctrl:
            self.box_select_extend_colliding()

        ## deselect colliding objects

        elif shift and ctrl:
            self.box_deselect_colliding()

        ## only colliding objects must become/remain selected

        elif not shift and not ctrl:

            self.deselect_all()
            self.box_select_extend_colliding()

        ### clean attributes which we won't use anymore
        self.clean_selection_box_attrs()

        ### set 'loaded_file' mode back and go to beginning
        ### of loop

        APP_REFS.wm.set_state("loaded_file")
        raise ContinueLoopException
Perform the box selection and needed setups.
nodezator/editing/selection.py