Pyautogui - Need to hold shift and click

这一生的挚爱 提交于 2019-12-02 00:01:26

问题


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


回答1:


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')


来源:https://stackoverflow.com/questions/52321602/pyautogui-need-to-hold-shift-and-click

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!