Skip to content

Commit ca8c892

Browse files
Merge pull request #1052 from StephenHodgson/MRTK-InputFixes
Fixed XboxController update regressions
2 parents 9250deb + 5c0eb4d commit ca8c892

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Assets/HoloToolkit-Examples/GamePad/Scenes/XboxControllerExample.unity

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,10 +701,10 @@ MonoBehaviour:
701701
m_Name:
702702
m_EditorClassIdentifier:
703703
DeviceRefreshInterval: 3
704-
horizontalAxis: 4
705-
verticalAxis: 5
706-
submitButton: 9
707-
cancelButton: 10
704+
horizontalAxis: 3
705+
verticalAxis: 4
706+
submitButton: 10
707+
cancelButton: 11
708708
mapping:
709709
- Type: 0
710710
Value:
@@ -744,3 +744,5 @@ MonoBehaviour:
744744
Value:
745745
- Type: 18
746746
Value:
747+
- Type: 19
748+
Value:

Assets/HoloToolkit/Input/Scripts/GamePad/XboxControllerMapping.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public static string GetMapping(XboxControllerMappingTypes type)
3434
{
3535
switch (type)
3636
{
37+
case XboxControllerMappingTypes.None:
38+
return string.Empty;
3739
case XboxControllerMappingTypes.XboxLeftStickHorizontal:
3840
return XboxLeftStickHorizontal;
3941
case XboxControllerMappingTypes.XboxLeftStickVertical:
@@ -81,6 +83,8 @@ public static void SetMapping(XboxControllerMappingTypes type, string value)
8183
{
8284
switch (type)
8385
{
86+
case XboxControllerMappingTypes.None:
87+
return;
8488
case XboxControllerMappingTypes.XboxLeftStickHorizontal:
8589
XboxLeftStickHorizontal = string.IsNullOrEmpty(value) ? "XBOX_LEFT_STICK_HORIZONTAL" : value;
8690
break;

Assets/HoloToolkit/Input/Scripts/InputSources/XboxControllerInputSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class XboxControllerInputSource : GamePadInputSource
1818
[Serializable]
1919
private class MappingEntry
2020
{
21-
public XboxControllerMappingTypes Type = 0;
21+
public XboxControllerMappingTypes Type = XboxControllerMappingTypes.None;
2222
public string Value = string.Empty;
2323
}
2424

0 commit comments

Comments
 (0)