Manimouse_Beta.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Manimouse 作者: shivamkajale 项目源码 文件源码
def chooseAction(yp, rc, bc):
    out = np.array(['move', 'false'])
    if rc[0]!=-1 and bc[0]!=-1:

        if distance(yp,rc)<50 and distance(yp,bc)<50 and distance(rc,bc)<50 :
            out[0] = 'drag'
            out[1] = 'true'
#           print 'dragging'
            return out
        elif distance(rc,bc)<40: 
            out[0] = 'left'
#           print 'left click'
            return out
        elif distance(yp,rc)<40:    
            out[0] = 'right'
#           print 'right click'
            return out
        else:
#           print 'moving'
            return out

    else:
        out[0] = -1
        return out      

# Movement of cursor on screen, left click, right click and dragging actions are performed here
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号