Cardinal directions incorrect for XBox One S Controller
I don't think this is directly a problem with gilrs, but it seems that evdev has incorrect aliases for BTN_NORTH, BTN_SOUTH, BTN_EAST and BTN_WEST. Incorrect in the sense that they are neither Nintendo nor XBox aliases, but a mixture of the two;
A -> South (XBox)
B -> East (XBox)
X -> North (Nintendo)
Y -> West (Nintendo)
The result with an XBox One controller is BTN_NORTH and BTN_WEST are swapped, while all other buttons work fine.
This post on a different project seems to agree
If using evdev directly, we could match on the un-aliased BTN_X..etc events, but these are not passed up by gilrs - the Buttons enum only contains the cardinal directions, which are not correct for my controller. This is also not a desirable solution as cardinal directions are much nicer to develop against, but it's the only solution I was able to find searching - and it is not possible with gilrs currently due to only the aliased events being reported.
The output from controllermap is as follows;
060082795e040000ea02000001030000,Xbox One S Controller,platform:Linux,a:b0,b:b1,x:b2,y:b3,back:b6,guide:b8,start:b7,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:a2,righttrigger:a5,
Pressing A B X Y in evtest gives;
Event: time 1672028921.690104, type 1 (EV_KEY), code 304 (BTN_SOUTH), value 1
Event: time 1672028921.690104, -------------- SYN_REPORT ------------
Event: time 1672028921.770250, type 1 (EV_KEY), code 304 (BTN_SOUTH), value 0
Event: time 1672028921.770250, -------------- SYN_REPORT ------------
Event: time 1672028921.962633, type 1 (EV_KEY), code 305 (BTN_EAST), value 1
Event: time 1672028921.962633, -------------- SYN_REPORT ------------
Event: time 1672028922.026828, type 1 (EV_KEY), code 305 (BTN_EAST), value 0
Event: time 1672028922.026828, -------------- SYN_REPORT ------------
Event: time 1672028922.877173, type 1 (EV_KEY), code 307 (BTN_NORTH), value 1
Event: time 1672028922.877173, -------------- SYN_REPORT ------------
Event: time 1672028922.957474, type 1 (EV_KEY), code 307 (BTN_NORTH), value 0
Event: time 1672028922.957474, -------------- SYN_REPORT ------------
Event: time 1672028923.149916, type 1 (EV_KEY), code 308 (BTN_WEST), value 1
Event: time 1672028923.149916, -------------- SYN_REPORT ------------
Event: time 1672028923.230085, type 1 (EV_KEY), code 308 (BTN_WEST), value 0
Event: time 1672028923.230085, -------------- SYN_REPORT ------------
(showing WEST and NORTH swapped)
This is without Steam Input enabled and an empty SDL_GAMECONTROLLERCONFIG. I am using the xone-dkms driver on Arch Linux.