def handle_input(self):
        """Iterate over events reacting to them."""
        ### iterate over events from the event queue

        for event in SERVICES_NS.get_events():

            ### if the user attempts to close the window,
            ### raise a custom exception to trigger the
            ### proper behaviour to quit the application

            if event.type == QUIT:
                raise QuitAppException

            ### KEYUP

            elif event.type == KEYUP:

                ## if one of the following keys is released,
                ## raise the SwitchLoopException without
                ## arguments, which causes the window manager
                ## to obtain control of the screen, that is,
                ## the splash screen looses focus and
                ## disappears

                if event.key in (K_ESCAPE, K_RETURN, K_KP_ENTER):
                    raise SwitchLoopException

                ## trigger system testing session

                elif (
                    event.key == K_F8
                    and event.mod & KMOD_SHIFT
                ):

                    if event.mod & KMOD_CTRL:
                        APP_REFS.ea.run_all_cases_at_max_speed()

                    else:
                        APP_REFS.ea.rerun_previous_test_session()

            ### KEYDOWN

            elif event.type == KEYDOWN:

                ## Application related operations

                # quit

                if event.key == K_q and event.mod & KMOD_CTRL:
                    raise QuitAppException

                ### closing file

                elif event.key == K_w and event.mod & KMOD_CTRL:

                    if hasattr(APP_REFS, 'source_path'):
                        raise CloseFileException

                # create new file
                elif event.key == K_n and event.mod & KMOD_CTRL:
                    APP_REFS.wm.new()

                # open file
                elif event.key == K_o and event.mod & KMOD_CTRL:
                    APP_REFS.wm.open()

            ### for each type of mouse event (motion,
            ### button pressing or button release),
            ### execute the corresponding event, passing
            ### along the event object

            elif event.type == MOUSEMOTION:
                self.on_mouse_motion(event)

            elif event.type == MOUSEBUTTONDOWN:
                self.on_mouse_click(event)

            elif event.type == MOUSEBUTTONUP:
                self.on_mouse_release(event)
Iterate over events reacting to them.
nodezator/splashscreen/op.py