I'm asking this because I haven't found anything clear about this subject after searching for days. So, I'm sorry if the question already exists.
I'm working in a project, just for fun, where I want to control the PC mouse from the Raspberry Pi. The user input would be done by any kind of hardware connected to the RP, my main doubt is about how to control to send the movement instructions to the PC from the RP through USB.
I know that I have to enable the OTG mode in order to make the PC recognize it as a usb device, but I have no idea about how to send the mouse movements to the PC through the USB and make Windows / Linux understand it. I found that "Linux-USB Gadget API Framework" exists, but there is no example about using it, and I don't actually know if it is the best approach.
Could you please give me some clues or resources to help me?
Thank you very much.
hid_gadget_test
program mentioned there, I do not have a pi handy but you might checkapt-file search hid_gadget_test
(andapt install apt-file
first if necessary).usbkbd.ko
g_ether
is used from when tethering the zero as an ethernet gadget (but it is the slave side, the host side driver is the more genericusbnet
).