Add support for the Xbox 360 "Big Button" wireless receiver - #16246
Conversation
a2993ab to
0533c77
Compare
0533c77 to
978ea39
Compare
|
In general this looks good. A few comments:
|
Will fix in the next revision
It's not super common, but it's enough to where I'll want to keep this around on my end for any 360 games that made use of this. The driver itself is really easy to support, but if we're worried about broad support it might be worth having the separate hint, but unlike the other 360 hints this could be disabled by default. |
Okay, fair enough. Let's just leave it gated by the existing 360 hint. |
978ea39 to
b89adcf
Compare
|
Latest revision removes the hint and moves the directional buttons to a hat. |
d2cb558 to
2a4eefd
Compare
|
Latest push cleans up the reordering a bit, was mostly working from my phone today... confirmed hat/ordering changes work as intended with the hardware. |
2a4eefd to
ff78a1b
Compare
|
Latest revision makes use of the SDL_GAMEPAD_BUTTON_ constants, including the enum Sam suggested. Note that back/guide/start got shuffled around, so the gamepad mapping got updated as well. |
3518359 to
0435df2
Compare
|
Latest push just squashes into one commit, thanks for looking at this Sam! |
You're welcome! |
Here's one for the history books:
Since FNA first started using SDL2, we've always mapped the Guide button to something XNA calls "BigButton":
https://github.com/FNA-XNA/FNA/blob/master/src/Input/Buttons.cs
Coming in without an XBLIG background, I was like, "oh, this is probably just the name for Guide... maybe it didn't have a name yet internally or something?" It's not like there's a Guide button in the XNA enum, so sure, it's gotta be the big button in the center of the controller, right?
How foolish I was: As it turns out, there is in fact a special button called the Big Button, and it's only found on this exact controller bundled with the Xbox version of Scene It (and Trivial Pursuit I think?):
The codename? "Big Button Controller". Oh.
This also explains this value we have in our gamepad type enum:
https://github.com/FNA-XNA/FNA/blob/master/src/Input/GamePadType.cs#L56
Unfortunately there are no Windows drivers, and we're still digging up an XBLIG dev setup to be sure, but we're now pretty confident that we've been advertising the wrong button for ~13 years. Woops!
This adds support for the Big Button receiver via libusb, and is confirmed working on Linux with a udev rule:
ValveSoftware/steam-devices#91
It's pretty straightforward, except that it only sends packets when a button is down, so I had to come up with a crude timer to send button release events when nothing is being pressed.