DEV Community

quandale dingle
quandale dingle

Posted on

How can I have two mice and keyboards, one pair controlled by a program?

I want to create a program that automatically does some tasks on the computer. I want these tasks to be done at the same time as the user is doing their own tasks. In order to do this, I would need to simulate a mouse and keyboard.

I want the two pairs of mice and keyboards to work separately, for example if program selected a textbox at the same time that a user selected a textbox and both the user and the program type something, I want what the user typed to go into the textbox that the user selected and what the program typed to go into the textbox that the program selected.

How can I do this? Thank you very much :)

I've tried libraries like pyautogui and others but they control the user's mouse and keyboard. I want the program to control its own mouse and keyboard.

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️