- Notifications
You must be signed in to change notification settings - Fork330
FIX: Correct north, east, south, west bindings for Switch Pro Controller to match the physical layout of the device#2208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:develop
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecov-github-combot commentedJul 29, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
vallerieknight-unity commentedJul 31, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
iOS CI issues appear to be instabilities also occurring on head of |
Uh oh!
There was an error while loading.Please reload this page.
| /// <summary> | ||
| /// A Button for a Nintendo Switch Pro Controller. | ||
| /// If querying via script, ensure you cast the device to SwitchProControllerHID, rather than using the Gamepad class. | ||
| /// The gamepad class will return the state of buttonSouth, whereas this class returns the state of buttonEast | ||
| /// </summary> | ||
| publicnewButtonControlaButton=>buttonEast; | ||
| /// <summary> | ||
| /// A Button for a Nintendo Switch Pro Controller. | ||
| /// If querying via script, ensure you cast the device to SwitchProControllerHID, rather than using the Gamepad class. | ||
| /// The gamepad class will return the state of buttonEast, whereas this class returns the state of buttonSouth | ||
| /// </summary> | ||
| publicnewButtonControlbButton=>buttonSouth; | ||
| /// <summary> | ||
| /// A Button for a Nintendo Switch Pro Controller. | ||
| /// If querying via script, ensure you cast the device to SwitchProControllerHID, rather than using the Gamepad class. | ||
| /// The gamepad class will return the state of buttonNorth, whereas this class returns the state of buttonWest | ||
| /// </summary> | ||
| publicnewButtonControlyButton=>buttonWest; | ||
| /// <summary> | ||
| /// A Button for a Nintendo Switch Pro Controller. | ||
| /// If querying via script, ensure you cast the device to SwitchProControllerHID, rather than using the Gamepad class. | ||
| /// The gamepad class will return the state of buttonWest, whereas this class returns the state of buttonNorth | ||
| /// </summary> | ||
| publicnewButtonControlxButton=>buttonNorth; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This is a change impacting all platforms, right? The Changelog gives the idea we only changed this for iOS,.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Ah, that's a good point; thanks! If it sounds OK to you, I can add a new changelog item to reference the aliases being corrected and state that this is updated for both iOS and standalone.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Just added new changelog item to help clear up why this was fixed here. If you think this should be a second PR, let me know - I combined it together, just as the actual issue there impacts both iOS & Standalone :)
| /// A Switch Pro Controller connected to an iOS device. | ||
| /// If you use InputSystem.GetDevice, you must query for this class rather than Gamepad in order for aButton, bButton, yButton and xButton to be correct | ||
| /// </summary> | ||
| [InputControlLayout(stateType=typeof(iOSGameControllerStateSwappedFaceButtons),displayName="iOS Switch Pro Controller Gamepad")] | ||
| publicclassSwitchProControlleriOS:Gamepad |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we need a new state? I wonder if we could actually create a similar pattern of what we dohere
Because the remapping seems to be done below, as we already did inSwitchProControllerHID.cs.
Maybe we would need to create aSwitchProController class. Which would be inherited bySwitchProControllerHID andSwitchProControlleriOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Currently, if you query buttonSouth, you'll get the A button's state, despite the fact buttonSouth is on the east on a Pro Controller. The new state maps this all correctly, such that buttonSouth will actually return the south face button.
The changes below are intended for situations when you want a button by label, regardless of where it is on the controller (e.g. some users will query this, and their UI in a tutorial will show "Press (A)").
If it makes this easier to land currently, I can split the changes to update aButton => buttonEast and friends into a new PR. This PR would then only focus on getting in the new state that rotates around the buttons for the Pro Controller.
Also agreed on the SwitchProController class as a root class; I'm just about to log off for the weekend, so I can make that change on Monday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Just pushed change that adds newSwitchProController device :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@vallerieknight-unity asking a lot here but a refactor like theSwitchProController forDualSense,DualShock,Xbox etc. is also much needed. We have so much boiler plate code as we otherwise get errors that specific controller features are not available on platform XY. We would expect that this is handled by the input system with an overall class per controller. Then if feature XY is not available on target XY it just does not perform the action and does not throw compile errors (e.g., PlayStation light bar). The same goes for creating actions and having to manually add targets to it due to different controller classes per platform. See the attached action we have for the select button on controllers to open a journal. You will notice we need several of the same controllers in there to make it work on all platforms the controller is used. Would bring a huge QoL improvement to using the input system.

ccbad00 to0b14515Compare… buttonsAlso includes new state, for any devices which use the Nintendo-y button bindings
0b14515 toe376be5Comparevallerieknight-unity commentedAug 12, 2025
(Sorry for the noise! Rebased on latest develop to resolve conflicts with changelog after the release of 1.14.2 and to get PVP changes) |
e376be5 toc5d6f72Comparevallerieknight-unity commentedSep 22, 2025
Converting back to draft to investigate status of Pro Controllers on iOS 26 |
ekcoh commentedOct 21, 2025
Merged develop into this branch to get critical CI fix from#2260. Hope this doesn't caused any inconvenience for you. |
vallerieknight-unity commentedOct 21, 2025
NP, thanks for doing the merge & giving a heads up :) |
vallerieknight-unity commentedOct 27, 2025
Took a hot second to find time for this 😅 . On latest iOS 26, this still works. I did correct the usages for iOS. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack#ask-u-pr-agent |
Uh oh!
There was an error while loading.Please reload this page.
jfreire-unity commentedDec 4, 2025
@vallerieknight-unity I moved the switch controller class into it's own file for consistency, even though its an abstract class. I think there are further changes that could be made not to have yet a new state for iOS, but since I don't have a controller with me I won't be able to validate them. |
3533b7a to4477b51Compare
Pauliusd01 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Checked the original switch pro controller functionality (I only own the switch 1 version, not sure if switch 2 refresh is different enough to warrant concerns) and didn't see any issues in-game, in debugger or with binding setting in editor.
Note that there's a lot of CI failures, some more valid than others for example this one:File contents must not match NDA regex patterns from the code analyzer
Uh oh!
There was an error while loading.Please reload this page.
Description
aButton,bButton,zButton,yButtonbinding to be correct for the Switch Pro ControllerTesting status & QA
Overall Product Risks
iOS : This could break som projects if the project already has mitigations for this behaviour, but, the behaviourwas incorrect previously, and customers in this position can disable the new device.
Standalone: Less likely to break customer projects, but, could break UI / tutorialisation if a user is assuming
.aButtonis always the same as button south. Happy to revert the standalone change, but if you are a Unity employee, please reach out on Slack as I can explain this decision making process further.Comments to reviewers
See above notes on some potential upgrade pain - would be good to have some feedback / thoughts from other folks on both of these risks.
Checklist
Before review:
Changed,Fixed,Addedsections.Area_CanDoX,Area_CanDoX_EvenIfYIsTheCase,Area_WhenIDoX_AndYHappens_ThisIsTheResult.During merge:
NEW: ___.FIX: ___.DOCS: ___.CHANGE: ___.RELEASE: 1.1.0-preview.3.After merge: