4 ms·
I've done this, it's super useful. The use case for me was that I wanted to simultaneously use two joysticks with the same game, mixing their inputs together in
by saulrh 3y ago
I've done this, it's super useful. The use case for me was that I wanted to simultaneously use two joysticks with the same game, mixing their inputs together instead of just using one or the other for each axis. The behavior only ended up being possible by writing a "joystick mux" program that would accept input from multiple joysticks, combine it, and then retransmit it as a gadget-mode device.
Side note, USB HID descriptors are a disaster and someone should do something about it. Even commercial devices by reputable manufacturers have broken descriptors. A tool with modern ergo and integration would probably get a surprising amount of traction.
https://github.com/saulrh/composite-joystick https://github.com/saulrh/composite-joystick
- h2odragon 3y agonifty project, thanks.
- sitkack 3y agoThis is awesome! A huge boon to digital artists those interested in HCI research. Also in rust! :) I also noticed how problematic it is to support even major controllers like the PS4 controller under SDL. Games have to be aware of the exact model of controller that they are attached to. I was thinking you could use a RPi0 and it could "clean" all the device specific issues. In your case, there is no reason that a FUSE like USB interposer couldn't exist purely in userland, but this is what we have.
- saulrh 3y agoI actually prototyped the thing in python the first time around, but performance was too poor to pass through even a single joystick, so Rust it was, lol. As for software translation, that was out early in the design process: I needed Windows and I did not want to write a Windows device driver or fight with code signing. Nor did I want a Windows-only or Linux-only solution. So the only solution was to control the platform the software ran on (-> raspberry pi), then drop down far enough in the stack that everyone agreed on a protocol (-> USB HID). I would have been very very happy if I could have implemented this at a higher level.
- sitkack 3y agoSorry, I re-read my comment and I wasn't trying to argue against you, just how messed up the OSes are and that everything is basically a stack of hacks, even the "good stuff". I like that you prototyped it in Python first. I wonder why it didn't work? Python function call overhead? It would be neat if there was a cross platform USB HID muxing and translation layer that used Wasm for all its logic, then the "fixups" would be portable.
- saulrh 3y agoI didn't do a ton of debugging before giving up and switching away from python, but I think that at least some of it was issues with the event loop and cost of serialization introducing latency. Yeah, I think some of my irritation with the situation bled through there, lol, didn't mean to come off as aggressive. I also lament the absence of a common input standard of some sort. WASM or the like would be a neat common layer; I feel like it's a good target for embedded scripting and module systems these days.
- hinkley 3y agoWhen I used to game cooperatively I always wanted a foot pedal, for push to talk or some defensive action. But I wonder if games that detect bots would trigger on this.
- StimDeck 3y agoNo way to know for every game, but foot pedals for PTT is definitely a thing for controller players in competitive PVP games. They are often sold as accessibility products.