I have the following script that is intended to take a screenshot of a video every 5sec by taking a screenshot, then hitting shift-right to fast-foward to the next 5sec interval, repeat. It looks like the shiftdown is not working, as whenever i do it manually, it works but whenever I run the script, the right button works but no shift.
time.sleep(2)
while t < 20:
time.sleep(0.5)
pyautogui.keyDown('shiftleft')
time.sleep(0.5)
pyautogui.press('right')
pyautogui.keyUp('shiftleft')
time.sleep(2)
screenshot = pyautogui.screenshot()
screenshot.save(loc + str(t) + '.png')
t = t + 1
time.sleep(0.5)