示例#1
0
文件: app.py 项目: ThisALV/RboClient
    def on_touch_up(self, touch: MotionEvent):
        if touch.grab_current is not self:
            return super().on_touch_move(touch)

        self.moving = False
        self.initPos = None
        self.lastDiff = None

        touch.ungrab(self)
        return True
示例#2
0
 def on_touch_up(self, touch: MotionEvent):
     tileTouched, row = self.findTileTouched(touch)
     if (tileTouched is not None and row is not None):
         if (touch.button == "left"):
             print(
                 tileTouched.coords, self.children.index(row),
                 row.children.index(tileTouched),
                 "WHITE" * self.board.turn + "BLACK" *
                 (not self.board.turn))
             self.handleSelection(tileTouched)
             self.arrowManager.removeArrows()
         else:
             self.unselectCase()
     if (touch.button == "right" and touch.grab_current is self):
         tileTouched, row = self.findTileTouched(touch)
         touch.ungrab(self)
         if (tileTouched is not None and row is not None):
             self.arrowManager.addArrow(self.lastTouchedTile, tileTouched)
     return super().on_touch_up(touch)
示例#3
0
 def on_touch_up(self, evt: MotionEvent) -> None:
     if evt.grab_current is self:
         evt.ungrab(self)