Pyautogui - 需要按住 shift 并单击 [英] Pyautogui - Need to hold shift and click

查看:83
本文介绍了Pyautogui - 需要按住 shift 并单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用pyautogui按住鼠标移动和点击?

How does one hold shift and and click with the mouse using pyautogui?

    pyautogui.hotkey('shift', click(1611, 600))

已经尝试了上面的行.但它不起作用

have tried the line above. But it doesn't work

推荐答案

hotkey() 函数仅适用于键.要按住 shift 单击,您需要这样的代码:

The hotkey() function only works with keys. To shift-click, you need code like this:

import pyautogui
pyautogui.keyDown('shift')
pyautogui.click()
pyautogui.keyUp('shift')

这篇关于Pyautogui - 需要按住 shift 并单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆