This is the first time I use the keyboard and the mouse via python and I am not sure whether it is not working or that I am doing something wrong.
I have imported: pywhatkit & pynput & pyautogui
KEYBOARD: all of the above are running fine up to the moment I want to let them press enter (or any other key).
Mouse: I can find the location of mouse via pyautogui 'x, y = pyautogui.position()' and this works fine and the x and y seems logical. However, changing the position via one of the above modules as well as clicking is not working.
It feels like that I am not authorised to make changes via python or something. The code isn't to hard and should be fine with the examples online. Is there a slider in MacOS that I need to switch?
One other thing that I found strange during this processes. when importing mouse it gives me this error:
import mouse
File "/Users/xxx/opt/anaconda3/lib/python3.9/site-packages/mouse/init.py", line 56, in <module> raise OSError("Unsupported platform '{}'".format(_platform.system())) OSError: Unsupported platform 'Darwin'
That is strange due to the fact that 'platform.system()' returns 'Darwin'. So I have looked into the file and indeed Darwin is not part of the code (see code below). However when I google it, I find versions that do support this module (https://github.com/boppreh/keyboard/blob/master/keyboard/mouse.py). Why is my version not supporting MacOS?
Looking in this file it starts with the below (above is all text that's why it is as far down as line 56):
version = '0.7.1'
import time as _time
import platform as _platform if _platform.system() == 'Windows': from. import _winmouse as _os_mouse elif _platform.system() == 'Linux': from. import _nixmouse as _os_mouse else: raise OSError("Unsupported platform '{}'".format(_platform.system()))