'Python - Generate 2nd Mouse Independent of Main Mouse

I have a code that uses pyautogui to move the mouse around on my 2nd monitor. However, this disables me from using the PC myself since the mouse is occupied.

Is it possible to create a replica mouse pointer just for the program, so that I can simultaneously use the computer with my own mouse?



Solution 1:[1]

From what I read in the documentation, it's not possible to have a second mouse working from your code while you are using your computer, because it's programmatically to control the mouse itself.

An that's why they use Fail-Safes as a safety feature.

As they say:

When a PyAutoGUI function is called, if the mouse is in any of the four corners of the primary monitor, they will raise a pyautogui.FailSafeException.

You can read more about from PyautoGUI documentation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Guilherme Matheus