

On Windows 8 and later, UAC can only be disabled by modifying the registry, and doing so breaks apps. If you are using Windows 8 or later, it is very unlikely that you have UAC disabled. Even "Run as administrator" from the context menu just runs the script normally - without admin if the user isn't an admin. If you temporarily disable UAC, turn on the option and re-enable UAC, there will be a tick in the box but the box itself will be disabled and the setting will have no effect. On Windows Vista at least, you can't even turn on the option if UAC is disabled.

PyAutoGUI uses Virtual Key Codes (VKs) and the deprecated mouse_event() and keybd_event() win32 functions. If it does not work for you, try using the pydirectinput module, it's an updated version of pyautogui (With almost the same functions - check the link). The above code works perfectly on my Windows PC. # Click the left button two times with a 0.2 second delay between clicksĬlick(button='left', clicks=2, interval=0.2) If isp(click_key): # If click key is pressed,

While not isp(stop_key): # Execute till the stop key is pressed Try using the pyautogui (and keyboard) module, as shown below: from keyboard import is_pressed as ispĭef clicky(click_key='.', stop_key='F10'):
