Open Med-JH opened 2 years ago
I noticed the example you linked to was for the original Raspberry Pi Zero W and you have the Pi Zero 2 W. Is it possible some functionality may have been removed?
I dont think that there is anything missing on the Pi Zero 2 becausse the example works, a "boot" mouse works and I also tested pikvm which has similar functionality. My guess is, that it is something with the reports, but I cant figure it out.
I skipped the Mouse and added Digitizer code to usb_hid.py
I used code from here https://gist.github.com/bitboy85/cdcd0e7e04082db414b5f1d23ab09005 and added it to usb_hid.py
Device.DIGI = Device.DIGI = Device(
descriptor=bytes(
# Absolute mouse
(0x05, 0x01) # Usage Page (Generic Desktop)
...
),
usage_page=0x1,
usage=0x02,
report_ids=[11],
in_report_lengths=[6], # Number of bytes in the send report = 1 byte for buttons, 2 bytes for x, 2 bytes for y, 1 byte for wheel
out_report_lengths=[0],
)
I then build mu code on based on mouse_abs.py
but mouse appears to be still broken in the current usb_hid.py
Good find. Like 99.9% of this was written by a community contributor, so I'm not really familiar with this module at all without really diving in. If you'd like to try and get it working, I'd be happy to review a PR.
I cant get mouse emulation working,
It is either becoming stuck or gives an error. If I follow this example I can send keyboard and mouse input. So the hardware and OS should be ok. I am also looking for a absolute mouse solution.
Thank you
Error variant:
Error:
stuck variant:
Spawns a keyboard on a connected Windows PC but no mouse. Instead of the mouse I get an failed HID device with Error:
mouse = Mouse(usb_hid.devices) never finishes
if I use
usb_hid.enable((usb_hid.Device.KEYBOARD, usb_hid.Device.MOUSE),boot_device=2)
I get a mouse but no keyboardmy preparation
lsb_release -a
boot/config.txt
pip list