pyautogui has this functions such as pyautogui.press(key), but I can't figure out how to press the windows key, can someone help me in this situation? Thanks
The string representation of the Windows key is "win":
>>> import pyautogui
>>> pyautogui.press("win")
Alternatively, you could pass the "winleft" and "winright" strings, which press the left and right Windows keys, respectively.
The pyautogui documentation has a list of keyboard strings which can be passed to the press(), keyDown(), and keyUp() functions.
According to pyautogui source code(take a look at line 123) and Microsoft keyboard map the windows button key name is 'super'.
pyautogui.press('super')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With