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.
In an UNO Tx and Rx are also used for the USB but Software Serial can be used for the second computer. Only get a converter to produce RS232 or what You prefer.
An Uno can't act as a HID device. You need a Leonardo or Micro for that.
The regular USB connection will be used for the HID communication. You can use a USB-TTL cable to connect to the second PC (the one originating the commands). If you are using a Leonardo you can connect the TTL output to the Pins 0 and 1 as they are Serial1 on the Leonardo and are separate from the regular USB cable - unlike on an Uno. You can do the same thing with a Micro but I am not sure how the Serial1 pins are numbered.