How to send input events to a USB Gadget?

130 Views Asked by At

I have setup my Raspberry Pi 4 Model B with the help of https://github.com/msawahara/raspi-usb-gadget to act as a Mouse when connected to an external computer. It seems to work because the external computer actually recognizes it as a USB Mouse, but when I try to send any inputs (I think I need to send it to /dev/hidg0 because when I run sudo ./gadget.sh get_hid_device hid.0 as shown in the readme file it outputs /dev/hidg0?). On the external computer when I try to send various inputs, nothing happenes and dmesg always only shows "usb 2-6: input irq status -75 received". Has anyone have had the same issues or maybe knows what I'm doing wrong?

I have tried using sudo sh -c "echo -ne '\x02\x00\x64\x00\x00\x00\x00\x00' > /dev/hidg0" and various python scripts to send inputs, but as I said I only receive "input irq status -75 received" on the external computer.

0

There are 0 best solutions below