Skip to content

Add share button mapping to Xbox Series X controller on Android#14921

Merged
slouken merged 1 commit intolibsdl-org:mainfrom
Nintorch:xbox-series-x-share-button-mapping
Feb 3, 2026
Merged

Add share button mapping to Xbox Series X controller on Android#14921
slouken merged 1 commit intolibsdl-org:mainfrom
Nintorch:xbox-series-x-share-button-mapping

Conversation

@Nintorch
Copy link
Copy Markdown
Contributor

Description

It seems that Xbox Series X controller mappings on Android in the internal mappings database (src/joystick/SDL_gamepad_db.h) don't have a mapping for the Share button. See also godotengine/godot#114338 (comment) .

Existing Issue(s)

I haven't found any.

@slouken
Copy link
Copy Markdown
Collaborator

slouken commented Jan 29, 2026

Did you test that this change enables the share button for Xbox Series X controllers on Android? If so, what versions of Android did you test, and did you test both Bluetooth and USB connections?

@slouken slouken added this to the 3.4.2 milestone Jan 29, 2026
@Nintorch
Copy link
Copy Markdown
Contributor Author

Nintorch commented Jan 30, 2026

@Alex2782 Hello, may I ask if you can test my original Godot PR and see if your controller is fixed there, please?

(In my original PR I included this fix and made the Android code read SDL's internal mappings database)
EDIT: Sorry, forget about this one, I will prepare an .apk file that uses SDL internally, not a Godot apk 😅

Oh I just realized that the code can't convert the required Android button to SDL button id, I will try to fix it!

@Nintorch Nintorch force-pushed the xbox-series-x-share-button-mapping branch from 99ec2e3 to 06019d3 Compare January 30, 2026 07:15
@Nintorch
Copy link
Copy Markdown
Contributor Author

EDIT: Sorry, forget about this one, I will prepare an .apk file that uses SDL internally, not a Godot apk 😅

Oh I just realized that the code can't convert the required Android button to SDL button id, I will try to fix it!

Done! Alex2782, may I ask if you can test this PR by downloading "SDL-android-arm64-apks.zip" file from this PR's artifacts later and running "testcontroller.apk", please?

@Alex2782
Copy link
Copy Markdown

Alex2782 commented Feb 3, 2026

Done! Alex2782, may I ask if you can test this PR by downloading "SDL-android-arm64-apks.zip" file from this PR's artifacts later and running "testcontroller.apk", please?

looks good!

Test, Video
Screen_recording_20260203_200203.mp4

@slouken slouken merged commit 997a168 into libsdl-org:main Feb 3, 2026
45 checks passed
@slouken
Copy link
Copy Markdown
Collaborator

slouken commented Feb 3, 2026

Merged, thanks!

@maia-s
Copy link
Copy Markdown
Contributor

maia-s commented Feb 3, 2026

Is it intended that this removes the value for AKEYCODE_BUTTON_L2 and assigns the same value for that and AKEYCODE_MEDIA_RECORD in SDL_sysjoystick.c?

@slouken
Copy link
Copy Markdown
Collaborator

slouken commented Feb 3, 2026

Is it intended that this removes the value for AKEYCODE_BUTTON_L2 and assigns the same value for that and AKEYCODE_MEDIA_RECORD in SDL_sysjoystick.c?

Yes, 15 is the value of MISC1, so it's just adding RECORD and using the more readable symbolic representation of the same value.

@Nintorch Nintorch deleted the xbox-series-x-share-button-mapping branch February 4, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants