I am using python to simulate key presses, the Pyautogui library is working fine for windows, but When I use it for linux, It only executes in the IDE in which it is running not other applications, how to fix this problem?
Here is my code:
import pyautogui #pip install pyautogui
import time
time.sleep(1)
pyautogui.keyDown('w') #press W key