Dheeraj
Dheeraj

Reputation: 11

Is it possible to run PyAutoGUI in the background?

I have written a few scripts which uses the pyautogui module in python. I want to understand if it is possible to run the program and the mouse and keyboard simulation with it in the background, where I can parallelly carry on with my regular work. I tried the follow methods, but failed : 1. Virtual desktop (in Windows 10, but this fails as the mouse simulation or the mouse itself is common between the actual and virtual desktop) 2. Virtual Machine (tried with the VM as well, the mouse simulation seems to fail again)

Please suggest, if there is any other workaround to achieve this. Thank you!

Upvotes: 1

Views: 5463

Answers (1)

Faraaz Kurawle
Faraaz Kurawle

Reputation: 1148

I have figured out a way by which you can let pyautogui work as well as do all your work at the same time with no VMs.

actually you cant run it in background, but you can do the thing mention above by these steps:-‎‎ ‎ㅤㅤㅤㅤㅤㅤ

  1. First, you need 2 keyboards and mouse attached on your windows computer.

  2. then install this application called mouse mux. https://www.mousemux.com/

  3. Then turn on 'multiplex input' and multiple keyboard option.

  4. Now you will be able to use 2 mouse and keyboards at the same time.

  5. put pyautogui in side my side view, and the first mouse and keyboard will be
    controlled by pyautogui and you can use 2nd mouse and keyboard to do something else

Note:_

Read the image carefully!.

enter image description here

Upvotes: 3

Related Questions