<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __update_mouse(self, milliseconds):
 """ Use the mouse to control selection of the buttons. """

        for button in self.gui_buttons:
            was_hovering = button.is_mouse_hovering
            button.update(milliseconds)

            #Provides capibilities for the mouse to select a button if the mouse is the focus of input.
            if was_hovering == False and button.is_mouse_hovering:
                #The user has just moved the mouse over the button. Set it as active.
                old_index = self.current_index
                self.current_index = self.gui_buttons.index(button)
                self.__handle_selections(old_index, self.current_index)
            elif Ragnarok.get_world().Mouse.is_clicked(self.mouse_select_button) and button.is_mouse_hovering:
                #The main mouse button has just depressed, click the current button.
                button.clicked_action()