mdqinc / SDL_GameControllerDB

A community sourced database of game controller mappings to be used with SDL2 Game Controller functionality
http://libsdl.org
zlib License
1.38k stars 520 forks source link

[xbox-one-s] Add new controller map #709

Closed drewgonzales360 closed 1 year ago

drewgonzales360 commented 1 year ago

I have an xbox one s controller and my right analog stick was giving me incorrect maps. I used the steam big picture mode to get this. The literal contents of the file were:

    "SDL_GamepadBind"       "03000000de280000ff11000001000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000de280000fc11000001000000,Steam Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
030000005e040000ea02000011050000,Xbox One S Controller,crc:7982,platform:Linux,a:b0,b:b1,x:b2,y:b3,dpleft:h0.8,dpright:h0.2,dpup:h0.1,dpdown:h0.4,leftx:a0,lefty:a1,leftstick:b9,rightx:a3,righty:a4,rightstick:b10,leftshoulder:b4,lefttrigger:a2,rightshoulder:b5,righttrigger:a5,back:b6,start:b7,guide:b8,steam:1,"

This is the output the current setup was giving me.

right stick up: Joypad Axis 4 (Joystick 2 Left)
right stick down: Joypad Axis 4 (Left Trigger)
right stick left: Joypad Axis 3 (Right Stick Up)
right stick right: Joypad Axis 3 (Right Stick Down)

This is my first time contributing here. Could someone help me test this or validate what I'm doing?

Open Question

I have a crc:7982,platform:Linux early in the line of my PR. I also have steam:1 at the end. Is that right?

offalynne commented 1 year ago

This is my first time contributing here. Could someone help me test this or validate what I'm doing?

Looks OK, you'll need to confirm yourself with the hardware on hand, I suggest grabbing the dedicated test app here http://www.generalarcade.com/gamepadtool/, copying the DB file with the changes I've committed overriding the pack-in gamecontrollerdb.txt file, and confirming the right thumbstick axes are working correctly upon running the app.

offalynne commented 1 year ago

Merging since the mapping matches similar devices, open an issue or another PR if the mapping tests incorrectly for you.

drewgonzales360 commented 1 year ago

Got it thanks! I wasn't able to test it using the tool you mentioned. In the readme, you also mentioned that it's out of date. Using the sdl docs, I was able to throw together a quick tool to test it and it works.

Thanks for the quick review :pray: