def update(self):
        """Check whether scroll buttons are being pressed."""
        ### if left mouse button is not pressed, exit method
        ### by returning earlier
        if not SERVICES_NS.get_mouse_pressed()[0]:
            return

        ### otherwise retrieve the position of the mouse
        ### and execute the command of one of the scroll
        ### buttons in case the mouse is hovering one
        ### of them

        mouse_pos = SERVICES_NS.get_mouse_pos()

        for button in self.buttons:

            if button.rect.collidepoint(mouse_pos):

                button.command()
                break
Check whether scroll buttons are being pressed.
nodezator/colorsman/editor/panel/main.py