MouseMovement.py 文件源码

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

项目:pytomatic 作者: N0K0 项目源码 文件源码
def move(self,coords, button=None):
        if all(isinstance(elem, float) for elem in coords):
            coords = self.to_pixel(coords)

        if button == None:
            _button_state = 0
        elif "right" in button.lower():
            _button_state = win32con.MK_RBUTTON
        elif "left" in button.lower():
            _button_state = win32con.MK_LBUTTON
        elif "middle" in button.lower():
            _button_state = win32con.MK_MBUTTON

        else:
            raise SyntaxError('"Button" needs to contain "left", "right" or "middle"')

        l_param = win32api.MAKELONG(coords[0], coords[1])
        win32api.PostMessage(self.win_handler.get_hwnd(), win32con.WM_MOUSEMOVE, _button_state, l_param)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号