Skip to content

Conversation

@Nintorch
Copy link
Contributor

@Nintorch Nintorch commented Oct 15, 2025

Based on #111707 (it can be closed if this PR can be merged)

I decided to split my big SDL3 joypad features PR ( #107967 ) into several smaller PRs, this PR is one of them.

This PR adds the ability to set the color/brightness of a joypad's LED light color, if it has one. An example of a controller with an LED light is DualShock 4.

This PR hasn't been tested yet 😅 but it should work correctly since I copied the code from my earlier PR that had this feature working correctly. After the CI passes, I will test it and create a small test project. (Not sure it's required, this PR is a pretty simple one, it only adds 2 more methods on top of the motion sensors PR)

TODO:

@Nintorch Nintorch requested review from a team as code owners October 15, 2025 14:11
@AThousandShips AThousandShips added this to the 4.x milestone Oct 15, 2025
@Nintorch Nintorch force-pushed the joypad-led branch 2 times, most recently from 2a8f3b9 to bad86bd Compare October 15, 2025 16:10
@Nintorch Nintorch force-pushed the joypad-led branch 2 times, most recently from 58c44c2 to 3ec4e25 Compare October 16, 2025 06:27
Copy link
Contributor

@Meorge Meorge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on macOS with both a DualSense (PS5) and DualShock (PS4) controller, wired and wireless, and works great in all cases! 😄

For convenience for anyone else testing this, here's a very minimal project that displays a color picker when a supported controller is connected:
test-joypad-led.zip

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on macOS and Windows with DualSense controller, working as expected.

@Nintorch
Copy link
Contributor Author

Nintorch commented Oct 20, 2025

Thank you for your reviews, bruvzg and AThousandShips!
I've modified the code to include AThousandShips' corrections!

@Repiteo Repiteo modified the milestones: 4.x, 4.6 Oct 22, 2025
@Nintorch
Copy link
Contributor Author

Nintorch commented Oct 31, 2025

Now that I think about it, should we provide an Input.get_joy_light() method but with a note that says this method only returns the color set by the game itself and not the other applications? Input.get_joy_vibration_strength() and duration basically work like that too
We can also remove the JoypadFeatures class in this case too, but then we won't be able to tell if the operation was successful. It that's important, we can leave it as is

@AThousandShips
Copy link
Member

I'd say to leave it without a method to get it to reduce clutter and confusion, assuming the color is expected to change downstream and the return value is expected to not be reliable

@Nintorch
Copy link
Contributor Author

Nintorch commented Nov 1, 2025

Thank you for your review, Mickeon! I included your suggested changes into the code!

@Nintorch
Copy link
Contributor Author

Nintorch commented Nov 5, 2025

May I ask if there are other reviewers that need to review this PR before it can be merged?

@Repiteo Repiteo merged commit 52e7b97 into godotengine:master Nov 14, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 14, 2025

Thanks!

@Nintorch
Copy link
Contributor Author

You're welcome! And thank you too! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants