def on_touch_start(self, x: int, y: int) -> None: if self.state is _DISABLED: return if in_area(self.area, x, y): self.state = _PRESSED self.repaint = True self.on_press_start()
def on_touch_end(self, x: int, y: int) -> None: state = self.state if state is not _INITIAL and state is not _DISABLED: self.state = _INITIAL self.repaint = True if in_area(self.area, x, y): if state is _PRESSED: self.on_press_end() self.on_click()
def on_touch_move(self, x: int, y: int) -> None: if self.state is _DISABLED: return if in_area(self.area, x, y): if self.state is _RELEASED: self.state = _PRESSED self.repaint = True self.on_press_start() else: if self.state is _PRESSED: self.state = _RELEASED self.repaint = True self.on_press_end()
def on_touch_start(self, x, y): if ui.in_area(self.area, x, y): self.start_x = x self.start_y = y self.light_origin = ui.BACKLIGHT_NORMAL
def on_touch_start(self, x: int, y: int) -> None: if ui.in_area(self.area, x, y): self.start_x = x self.start_y = y self.light_origin = ui.BACKLIGHT_NORMAL self.started = True