Open Beanow opened 1 year ago
Sorry for the late response. I think this is the correct thing to do, my only questions what button to use. I tried looking around in different input and joystick drivers but could not see any other uses of HAPPY11. Is it up to our discretion to choose one?
I'm not completely sure either. Maybe @mbenkmann had a rationale for this number specifically.
But my understanding is that... 14 years ago https://github.com/torvalds/linux/commit/cf2f765f1896064e34c6f0f2ef896ff058dd5c06 the BTN_TRIGGER_HAPPY*
range was added since the existing BTN_*
range was too short to cover controllers with more buttons.
Looking at a recent addition of trigger happy to xpad.c
which adds back paddles like these:
They seem to be using BTN_*
and BTN_TRIGGER_HAPPY*
freely mixed though. So rather than starting at HAPPY11
because it happens to be the 11th button. You also see HAPPY1 - 4
in case the D-pad is mapped to buttons rather than an axis. And the new HAPPY5 - 8
for the paddles.
I think if we're looking to avoid conflicts with what xpad
is defining anywhere above HAPPY9
appears unclaimed.
(Nb: Android seems to have the RECORD binding, and xpadneo maps to F12
to try and trigger steam's screenshots )
There's discussion in xpadneo btw including feedback from the SDL side: https://github.com/atar-axis/xpadneo/issues/428#issuecomment-1590221701 There wasn't a conclusion on the SHARE button specifically, but looking through it there certainly seems more to it than just pick one :laughing:
Actually, while the thread said KEY_RECORD
probably wasn't the best idea to go into the kernel. It is in the kernel for xpad.c
and so SDL added support too. https://github.com/libsdl-org/SDL/commit/db1d4d3d76f5e21b2547463710b513fe0ebd7fad#diff-7d94ff2175e20395f77eafb0287c2f5efa984bc6adfba9a1becd6cd2a8314187R2110
The maintainer there at least seems to have gone from RECORD to HAPPY1 to F12, with more plans to look for better solutions.
Porting over from https://github.com/medusalix/xone/pull/20
On kernel
6.5.5
, can confirm thatevtest
is updated accordingly and under Firefox https://luser.github.io/gamepadtest/ will report the share button as a working 11th button. Though it doesn't seem to work under Edge (flatpak) or Rocket League (proton 8.0).