Add support for SDL3 joystick input driver for the web platform (Emscripten)#114318
Closed
Nintorch wants to merge 1 commit intogodotengine:masterfrom
Closed
Add support for SDL3 joystick input driver for the web platform (Emscripten)#114318Nintorch wants to merge 1 commit intogodotengine:masterfrom
Nintorch wants to merge 1 commit intogodotengine:masterfrom
Conversation
This commit also adds joystick vibration feature to the web platform in browsers that support this feature.
19 tasks
Nintorch
commented
Dec 24, 2025
Comment on lines
+335
to
+338
| - 'weakMagnitude': $1 / 0xFFFF, | ||
| - 'strongMagnitude': $2 / 0xFFFF, | ||
| + 'weakMagnitude': $2 / 0xFFFF, | ||
| + 'strongMagnitude': $1 / 0xFFFF, |
Comment on lines
+9
to
+10
| - "default,Standard Gamepad,a:b0,b:b1,back:b8,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b16,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,", | ||
| + "default,*,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b10,leftshoulder:b4,leftstick:b8,lefttrigger:a4,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:a5,rightx:a2,righty:a3,start:b7,x:b2,y:b3,", |
| static SDL_joylist_item *SDL_joylist_tail = NULL; | ||
| static int numjoysticks = 0; | ||
|
|
||
| +EM_JS(int, SDL_GetEmscriptenJoystickVendor, (int device_index), { |
Contributor
Author
|
Although now that I think about it, I'm not sure if this PR is necessary since it doesn't fix a lot of issues, and the vibration issue I linked can easily be fixed without integrating SDL. |
Contributor
Author
|
I decided it's not really worth it to integrate SDL's Android and web joystick drivers since that wouldn't fix a lot of issues and it might introduce regressions, and the only benefit might be that we'll be able to port small fixes from/to SDL more easily, unless I'm misunderstanding something, so I'll close this PR for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #106218
Fixes #96985
I decided to split #109645 into several smaller PRs, this PR is one of them.
This PR adds support for SDL3 joystick input driver for the web platform, as well as adding support for
Input.get_joy_info()on that platform.TODO: