[Solved] Sending mouse inputs from one computer to another using Arduino Micro.

Hello everyone, I was not able to find an answer for this by searching.

I am aware how to send information containing target mouse position to the micro serially.

What I am trying to achieve is the following:

PC(1) presses a certain button, the current mouse position is sent to the micro (I have achieved this).
The micro then presses the mouse button in the target position on PC(2).

I think I am correct in assuming that one of these computers should be connected to Serial1, I am just not sure which one or how I should go about doing it. Thanks for any advice in advance!

The problem is in achieving some target position. The mouse is just a dumb device that sends only up-down-left-right commands and has no idea where the pointer is. Only the PC OS knows that.

Hi, functionally I have already simulated what I need to happen on the same computer. All I would like to figure out is how to send mouse commands to a pc, while receiving serial information from a different pc. Thanks!

Edit: To clarify, when I say "send mouse commands" I mean how to make Mouse.someFunction work for the target PC, not how to implement what I want to happen.

callanb:
PC(1) presses a certain button, the current mouse position is sent to the micro (I have achieved this).

Please provide a detailed description of how you did it.

callanb:
I think I am correct in assuming that one of these computers should be connected to Serial1

If you want to use the Mouse library, the Micro must be connected to PC(2) via the USB socket on the Micro. You cannot use the Mouse library with Serial1. This means you cannot use the USB socket on the Micro to connect the Micro to PC(1).

So you need to use some other communication channel to connect with PC(1). Serial1 is definitely a good option for this. USB to TTL serial adapter modules (AKA "FTDI") are cheap and widely available. You just connect the module to the RX and TX pins of Serial1 on your Micro (pins 0 and 1), then the USB cable to PC(1), and the adapter provides a virtual COM port just like when you connect your Arduino boards to your computer normally.

Perfect reply pert thanks for your help, I was leaning towards USB to TTL but didn't find any online resources confirming this. Closing the thread.