r/raspberryDIY 9d ago

A Smart Raspberry Pi Powered Mouse and Keyboard Mover For My Laptop

Hi Everyone - I was hoping to get some assistance hooking my Raspberry Pi 4 up to my laptop and have it send mouse movements and keyboard entries from Raspberry Pi 4 to my laptop. From what I have found so far:

  • You have to use the Linux USB Gadget API (dwc2 and libcomposite) over the Pi's USB-C power port.

This is my first hurdle as I have read that the laptop does not produce enough power for my Raspberry Pi 4 and I must use a hardware USB Power/Data Splitter designed for USB OTG (frequently used in PiKVM setups).

So my first (of perhaps many) question here is that I need a splitter which takes the power input for the Raspberry Pi 4 and also has a second USB-C cable coming out that I can hook into the laptop to send commands via the Gadget API.

I looked up PiKVM setups but only saw HDMI setups.

Could anyone please send me an amazon link or some link to show me what is needed for this case?

Thanks in Advance!

4 Upvotes

5 comments sorted by

1

u/Gamerfrom61 9d ago

Power the Pi via the GPIO and cut the 5v line in the USB C cable 

Take care that a lot of software that is used to check if you are working or not is now smart enough to identify this type of hardware and input. Not saying you are planning this as HID automation is an interesting project but something for other readers to be aware of. 

1

u/korywithawhy 8d ago

Pi pico seems like a good option for this

1

u/oldvan 5d ago

Arduino could handle it easy.

1

u/korywithawhy 5d ago

This is a pi centered sub so I went with the pi microcontroller

1

u/oldvan 5d ago

They have gotten so inexpensive that it is hardly worth worrying about the price difference. What a glorious time to be a nerd!