Skip to content

Commit

Permalink
fix(SDK): prevent SteamVR SDK reporting a button two press
Browse files Browse the repository at this point in the history
Previously, the SteamVR SDK would report the Application Menu button
press as being ButtonOne and ButtonTwo. This is sematically incorrect
as the Vive controller does not have a button two and therefore
requesting if button two has been pressed should always return false.
  • Loading branch information
thestonefox committed Jan 1, 2017
1 parent fd9a285 commit 748902d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Assets/VRTK/SDK/SteamVR/SDK_SteamVRController.cs
Expand Up @@ -673,7 +673,7 @@ public override bool IsButtonOneTouchedUpOnIndex(uint index)
/// <returns>Returns true if the button is continually being pressed.</returns>
public override bool IsButtonTwoPressedOnIndex(uint index)
{
return IsButtonPressed(index, ButtonPressTypes.Press, SteamVR_Controller.ButtonMask.ApplicationMenu);
return false;
}

/// <summary>
Expand All @@ -683,7 +683,7 @@ public override bool IsButtonTwoPressedOnIndex(uint index)
/// <returns>Returns true if the button has just been pressed down.</returns>
public override bool IsButtonTwoPressedDownOnIndex(uint index)
{
return IsButtonPressed(index, ButtonPressTypes.PressDown, SteamVR_Controller.ButtonMask.ApplicationMenu);
return false;
}

/// <summary>
Expand All @@ -693,7 +693,7 @@ public override bool IsButtonTwoPressedDownOnIndex(uint index)
/// <returns>Returns true if the button has just been released.</returns>
public override bool IsButtonTwoPressedUpOnIndex(uint index)
{
return IsButtonPressed(index, ButtonPressTypes.PressUp, SteamVR_Controller.ButtonMask.ApplicationMenu);
return false;
}

/// <summary>
Expand All @@ -713,7 +713,7 @@ public override bool IsButtonTwoTouchedOnIndex(uint index)
/// <returns>Returns true if the button has just been touched down.</returns>
public override bool IsButtonTwoTouchedDownOnIndex(uint index)
{
return IsButtonPressed(index, ButtonPressTypes.TouchDown, SteamVR_Controller.ButtonMask.ApplicationMenu);
return false;
}

/// <summary>
Expand All @@ -723,7 +723,7 @@ public override bool IsButtonTwoTouchedDownOnIndex(uint index)
/// <returns>Returns true if the button has just been released.</returns>
public override bool IsButtonTwoTouchedUpOnIndex(uint index)
{
return IsButtonPressed(index, ButtonPressTypes.TouchUp, SteamVR_Controller.ButtonMask.ApplicationMenu);
return false;
}

[RuntimeInitializeOnLoadMethod]
Expand Down

0 comments on commit 748902d

Please sign in to comment.