Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pyautogui: press two keys at the same time

I am using pyautogui to simulate pressing shift and end at the same time - when I type this myself, it highlights all the entries, however when I do it via the code below, it just moves to the end file - not highlighting every component, so it seems like shift isn't being pressed. Was wondering if anyone had any ideas?

pyautogui.keyDown('shift')
pyautogui.keyDown('end')
pyautogui.keyUp('end')
pyautogui.keyUp('shift')
like image 724
timr Avatar asked Mar 12 '17 14:03

timr


1 Answers

I know this question is old, but you can get the same result by doing:

pyautogui.hotkey('shift', 'end')
like image 124
callium Avatar answered Sep 22 '22 00:09

callium