asweigart / pyautogui

A cross-platform GUI automation Python module for human beings. Used to programmatically control the mouse & keyboard.
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.24k forks source link

Problems with hotkey #872

Open PeaceAndJoyAaron opened 1 month ago

PeaceAndJoyAaron commented 1 month ago

Hi,guys,I have currently written a test script with the following content `import time import pyautogui

time.sleep(1)

pyautogui.mouseDown(button='left') pyautogui.mouseUp(button='left') pyautogui.hotkey('ctrl', 'shift', 'down') print('Script completed.')`

And I have also tried to write it in the following format

`import time import pyautogui

time.sleep(1)

pyautogui.mouseDown(button='left') pyautogui.mouseUp(button='left') pyautogui.keyDown('ctrl') pyautogui.keyDown('shift') pyautogui.keyDown('down') pyautogui.keyUp('down') pyautogui.keyUp('shift') pyautogui.keyUp('ctrl') print('Script completed.')`

But currently, it seems that either way of writing will render 'shift' ineffective. Looking forward to receiving a response, thank you very much