I'm a beginner with pyautogui and I had same issue that pyautogui.hotkey not working as expected but I found out that you can do pretty much the same thing with keyDown and keyUp
# Press Windows + Up Arrow
pyautogui.keyDown("winleft") # Press Windows key
pyautogui.press("up") # Press Up Arrow key
pyautogui.keyUp("winleft") # Release Windows key
and then you can write your own hotkey function
# my hotkey function
def press_hotkey(key1, key2):
pyautogui.keyDown(key1) # Press first key
pyautogui.press(key2) # Press second key
pyautogui.keyUp(key1) # Release first key