<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mouse_button_callback(self, window, button, action, mods):

 """
 Handle mouse button events and forward them to the example
 """

        # Offset button index by 1 to make it match the other libraries
        button += 1
        # Support left and right mouse button for now
        if button not in [1, 2]:
            return

        xpos, ypos = glfw.get_cursor_pos(self.window)

        if action == glfw.PRESS:
            self.example.mouse_press_event(xpos, ypos, button)
        else:
            self.example.mouse_release_event(xpos, ypos, button)