Send input from C++ program to Arduino through the RX and TX pins

I am really new to Arduino and probably bad at explaining but..

I have 2 computers. 1 computer should send input to the arduino and then the arduino reads the input and does HID input on the other computer. So one computer should be connected to the usb and the other computer which send the input should be somehow connected to the RX and TX. Example: I type in the console "1" and the first PC sends the input to arduino and then it clicks the mouse on the second computer. If I send "0" nothing happens. Is this possible? I have a Uno and a Leonardo so I could use any of them.

I presume if you are doing HID you are using a Leonardo or Micro - it helps to tell us that sort of thing,

You can connect your PC to Pins 0 and 1 and GND on a Leonardo (Serial1) using a USB-TTL cable. Then the HID stuff will go over the regular USB cable.