i want to use Pyautogui and Keyboard module at the same time (Using Python), but i can't do that. i have installed Keyboard module and Pyautogui module too, but when i try to run Pyautogui via root i get this error (sudo python3)
raise error.DisplayConnectionError(self.display_name, r.reason)
Xlib.error.DisplayConnectionError: Can't connect to display ":1": b'Authorization required, but no authorization protocol specified\n'
without root, it works. but keyboard doesn't work without root.
raise ImportError('You must be root to use this library on linux.')
ImportError: You must be root to use this library on linux.
I am using .is_pressed() function in keyboard module.