Skip to content

Commit 9ab29ab

Browse files
Correct Switch Pro Controller button bindings for HID desktop
1 parent ea1676c commit 9ab29ab

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Packages/com.unity.inputsystem/InputSystem/Plugins/Switch/SwitchProControllerHID.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,34 @@ public class SwitchProControllerHID : Gamepad, IInputStateCallbackReceiver, IEve
155155
[InputControl(name = "home", displayName = "Home")]
156156
public ButtonControl homeButton { get; protected set; }
157157

158+
/// <summary>
159+
/// A Button for a Nintendo Switch Pro Controller.
160+
/// If querying via script, ensure you cast the device to SwitchProControllerHID, rather than using the Gamepad class.
161+
/// The gamepad class will return the state of buttonSouth, whereas this class returns the state of buttonEast
162+
/// </summary>
163+
public new ButtonControl aButton => buttonEast;
164+
165+
/// <summary>
166+
/// A Button for a Nintendo Switch Pro Controller.
167+
/// If querying via script, ensure you cast the device to SwitchProControllerHID, rather than using the Gamepad class.
168+
/// The gamepad class will return the state of buttonEast, whereas this class returns the state of buttonSouth
169+
/// </summary>
170+
public new ButtonControl bButton => buttonSouth;
171+
172+
/// <summary>
173+
/// A Button for a Nintendo Switch Pro Controller.
174+
/// If querying via script, ensure you cast the device to SwitchProControllerHID, rather than using the Gamepad class.
175+
/// The gamepad class will return the state of buttonNorth, whereas this class returns the state of buttonWest
176+
/// </summary>
177+
public new ButtonControl yButton => buttonWest;
178+
179+
/// <summary>
180+
/// A Button for a Nintendo Switch Pro Controller.
181+
/// If querying via script, ensure you cast the device to SwitchProControllerHID, rather than using the Gamepad class.
182+
/// The gamepad class will return the state of buttonWest, whereas this class returns the state of buttonNorth
183+
/// </summary>
184+
public new ButtonControl xButton => buttonNorth;
185+
158186
protected override void OnAdded()
159187
{
160188
base.OnAdded();

0 commit comments

Comments
 (0)