def update(self, event):
    if (self.in_click and (event.type == (pygame.USEREVENT + 1)) and (BFControlId().instance().click_id == self.ctl_id)):
        if self._click:
            self._click(self)
        self.click_event_id = (- 1)
        return True
    (x, y) = pygame.mouse.get_pos()
    if ((x > self.x) and (x < (self.x + self.width)) and (y > self.y) and (y < (self.y + self.height))):
        if self.panel:
            self.panel.clear_hover()
        self.is_hover = True
        if (event.type == MOUSEBUTTONDOWN):
            pressed_array = pygame.mouse.get_pressed()
            if pressed_array[0]:
                self.in_click = True
                if self.panel:
                    self.panel.clear_foucs()
                self.click_loss_time = (pygame.time.get_ticks() + CLICK_EFFECT_TIME)
                BFControlId().instance().click_id = self.ctl_id
                pygame.time.set_timer((pygame.USEREVENT + 1), (CLICK_EFFECT_TIME - 10))
        return True
    else:
        self.is_hover = False
    return False
def update(self, event):
    if (self.in_click and (event.type == (pygame.USEREVENT + 1)) and (BFControlId().instance().click_id == self.ctl_id)):
        if self._click:
            self._click(self)
        self.click_event_id = (- 1)
        return True
    (x, y) = pygame.mouse.get_pos()
    if ((x > self.x) and (x < (self.x + self.width)) and (y > self.y) and (y < (self.y + self.height))):
        if self.panel:
            self.panel.clear_hover()
        self.is_hover = True
        if (event.type == MOUSEBUTTONDOWN):
            pressed_array = pygame.mouse.get_pressed()
            if pressed_array[0]:
                self.in_click = True
                if self.panel:
                    self.panel.clear_foucs()
                self.click_loss_time = (pygame.time.get_ticks() + CLICK_EFFECT_TIME)
                BFControlId().instance().click_id = self.ctl_id
                pygame.time.set_timer((pygame.USEREVENT + 1), (CLICK_EFFECT_TIME - 10))
        return True
    else:
        self.is_hover = False
    return False