Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through all the devices #41

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

Daft-Freak
Copy link

... well, up to four because of kernel limit on HID functions.

Ended up looking at this more than I intended to, so there are a bunch of changes here.

  • Some improvements to error handling to not end up with a broken gadget if you don't follow the instructions properly. (Though I did break it a bit until the end...)
  • Some refactoring to avoid hardcoding the device paths. Not sure how correct this is, but it worked.
  • More refactoring to split keyboard/mouse into separate functions and pass through the report descriptors. (Theoretically meaning any mouse would work, but the one I had lying around happens to be identical to the pi one)
  • Even more refactoring to build a list of all devices and pass them through. As a nice bonus, this works for forwarding bluetooth devices. (Tested with a switch pro controller, which mostly worked)

Currently this introduces a few new issues:

  • Completely fails to start if there are more than four hidraw devices.
  • Keyboard has two hidraw devices for some reason, don't know what the other one is for considering it worked fine passing through the first one. This does not help with the previous limit.
  • Some devices result in a lot of spam from printing the reports
  • Passed through game controllers get messed up mappings, probably because the host can't identify them correctly.
  • Also, it's only lightly tested.

@Gadgetoid
Copy link
Owner

This is beautifully awesome. Thank you! Time to dig up a Pi 400 👀

I have a suspicion the keyboard's dual devices are the keyboard itself - probably regular boot protocol - plus a separate media keys device. I guess the keyboard controller is pretty turnkey, so it made no sense for the Pi 400 to diverge away from it. (Though I suspect just because I can't imagine why a Pi 400 would ever need a boot compatible keyboard, doesn't mean there isn't a reason.)

@Gadgetoid
Copy link
Owner

Fired up a Pi 400, remembered to follow my own instructions, got it up and running, and it just goes BOOP BEEP BOOP and grabs all the things and just works.

Slightly less success with my 8bitdo ultimate controller (2.4GHz/USB HID), but it's the K(v)M that matters.

Very, very nice.

@HarvsG
Copy link

HarvsG commented Aug 5, 2023

Merge?

@JackDanger
Copy link

This is wonderful. Would love a merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants