Skip to content

Support adding advanced joypad features#111707

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
Nintorch:joypad-features
Nov 11, 2025
Merged

Support adding advanced joypad features#111707
Repiteo merged 1 commit into
godotengine:masterfrom
Nintorch:joypad-features

Conversation

@Nintorch
Copy link
Copy Markdown
Member

@Nintorch Nintorch commented Oct 16, 2025

Base PR for #111679, #111681, #111682 and others.

Fixes #78805 (see #107967 (comment) )

This PR adds the option to add more advanced features to joypads in the future that require the Input code to call methods from JoypadSDL (or other drivers) without breaking encapsulation, basically dependency injection. Such methods include, for example, checking if a joypad has motion sensors, LED lights, enabling the motion sensors, changing LED light color, etc.

This PR also adds the HIDAPI joysticks support for Linux and macOS, as well as Windows sensors subsystem so that it can be used later for motion sensors and other features.

This PR is separated from the other 3 so that they can be reviewed independently from the motion sensors PR. Let me know if this is a good idea :D

Copy link
Copy Markdown
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally on Windows 11 24H2 with a DualSense Edge on the joypads demo (rebased on top of master 6fd949a), it works as expected. Code looks good to me.

(This PR doesn't add any new features, but I still tested it to ensure there are no regressions from this PR on its own.)

Copy link
Copy Markdown
Contributor

@Repiteo Repiteo left a comment

Choose a reason for hiding this comment

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

The changes are indeed isolated, and having a standalone foundation makes perfect sense

@Repiteo Repiteo modified the milestones: 4.x, 4.6 Nov 11, 2025
@Repiteo Repiteo merged commit 180ccae into godotengine:master Nov 11, 2025
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Nov 11, 2025

Thanks!

@Nintorch Nintorch deleted the joypad-features branch November 12, 2025 00:50
@gtibo
Copy link
Copy Markdown
Contributor

gtibo commented Jan 14, 2026

Hello @Nintorch,
I am currently gathering images and videos for the version 4.6 page.
Do you have a photo or video illustrating this feature as an example?

I do not have a controller that allows me to manage the color of the LEDs.

image

https://gtibo.github.io/godot-4.6-release-page/

To give you some context, this is your PR entry on the page (System > Input sub-section)

@Nintorch
Copy link
Copy Markdown
Member Author

I do! https://drive.google.com/file/d/1X-obbkyEhNIYN3KO7HVYnvNIRTM41VoY/view?usp=sharing
I hope this video is okay, because I currently temporarily don't have access to my DualShock 4 to make a new one 😅
Also, I have a suggestion regarding the text of the panel: I'm not sure controllers support button resistance, or if it's possible via SDL, and I would consider gyroscope as a motion sensor, so they shouldn't be separate, if that's okay :D

@gtibo
Copy link
Copy Markdown
Contributor

gtibo commented Jan 14, 2026

I do! https://drive.google.com/file/d/1X-obbkyEhNIYN3KO7HVYnvNIRTM41VoY/view?usp=sharing I hope this video is okay, because I currently temporarily don't have access to my DualShock 4 to make a new one 😅 Also, I have a suggestion regarding the text of the panel: I'm not sure controllers support button resistance, or if it's possible via SDL, and I would consider gyroscope as a motion sensor, so they shouldn't be separate, if that's okay :D

Hey Nintorch! Thanks for the quick reply :)!
Your video is a bit too out of focus and I would need something in a 16/9 ratio (1920/1080 - 1280/720) to work on the website. I'll ask around if someone have the right controller for that!

Thanks for the feedback, if you want, you can make a PR on the page project to edit the text so it better fit your vision.

@Nintorch
Copy link
Copy Markdown
Member Author

You're welcome! :)

@Tio-Henry
Copy link
Copy Markdown

Hey Nintorch, in is moment, only the Light Bar have access in Godot 4.6?

@Nintorch
Copy link
Copy Markdown
Member Author

Nintorch commented Feb 4, 2026

Hey Nintorch, in is moment, only the Light Bar have access in Godot 4.6?

Hi :) Yes, in Godot 4.6 the only advanced joypad feature is the light bar.
But the joypad motion sensors support have already been merged and they will come in Godot 4.7!

@Tio-Henry
Copy link
Copy Markdown

Have prediction for Adaptive Triggers?

@Nintorch
Copy link
Copy Markdown
Member Author

Nintorch commented Feb 4, 2026

Have prediction for Adaptive Triggers?

We're currently not sure if they should be built into Godot or be available as an addon in the future when I expose an SDL subsystem that can be used (HIDAPI).

@Tio-Henry
Copy link
Copy Markdown

SDL is only in Windows, and the HIDAPI in Linux and MacOS?

@Nintorch
Copy link
Copy Markdown
Member Author

Nintorch commented Feb 4, 2026

In Godot SDL is used on Windows, Linux and macOS, and hidapi is available on all these 3 platforms :)

@Tio-Henry
Copy link
Copy Markdown

Having problems in expose more features?

@Nintorch
Copy link
Copy Markdown
Member Author

Nintorch commented Feb 4, 2026

One of the problems is the lack of willingness to write all the boilerplate code that is required for new classes 😅 (see also #114642 for an example)

@akien-mga
Copy link
Copy Markdown
Member

akien-mga commented Feb 4, 2026

@Tio-Henry Please avoid using a merged PR as a Q&A which isn't directly linked to the PR itself. If you have questions about the implementation, you can join the Godot contributors chat to ask about it.

@Tio-Henry
Copy link
Copy Markdown

Wow, I took a look, and for each feedback effect, is it necessary to write separate code for each one?

@Tio-Henry
Copy link
Copy Markdown

@Tio-Henry Please avoid using a merged PR as a Q&A which isn't directly linked to the PR itself. If you have questions about the implementation, you can join the Godot contributors chat to ask about it.

I'm sorry

kilian-diener added a commit to kilian-diener/godot that referenced this pull request Feb 26, 2026
Co-authored-by: Nintorch <92302738+Nintorch@users.noreply.github.com>
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.

Godot does not recognize all buttons of a Nintendo Switch Joycon

7 participants