How to trigger a Windows and L key Python-hotkey?

Craftx398 picture Craftx398 · Apr 2, 2017 · Viewed 8.9k times · Source

I am trying to run this code in Python.

import pyautogui
pyautogui.hotkey('win', 'l')

So that when I run it it will trigger switch user in Windows but all it does is press l when I need it to press Win+l

Answer

Zanark picture Zanark · Apr 13, 2019

I had this issue for Win+V and instead of using the hotkey function I used:

pyautogui.keyDown('winleft')
pyautogui.press('v')
pyautogui.keyUp('winleft')