Skip to content

Commit bd5f066

Browse files
Merge pull request #1053 from StephenHodgson/MRTK-2017.2-XboxFixes
Mrtk 2017.2 Xbox Controller Regression Fixes
2 parents b2ffe55 + 2304a47 commit bd5f066

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -707,10 +707,10 @@ MonoBehaviour:
707707
m_Name:
708708
m_EditorClassIdentifier:
709709
DeviceRefreshInterval: 3
710-
horizontalAxis: 4
711-
verticalAxis: 5
712-
submitButton: 9
713-
cancelButton: 10
710+
horizontalAxis: 3
711+
verticalAxis: 4
712+
submitButton: 10
713+
cancelButton: 11
714714
mapping:
715715
- Type: 0
716716
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) ? "CONTROLLER_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)