Skip to content

Commit 748902d

Browse files
committed
fix(SDK): prevent SteamVR SDK reporting a button two press
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.
1 parent fd9a285 commit 748902d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Assets/VRTK/SDK/SteamVR/SDK_SteamVRController.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ public override bool IsButtonOneTouchedUpOnIndex(uint index)
673673
/// <returns>Returns true if the button is continually being pressed.</returns>
674674
public override bool IsButtonTwoPressedOnIndex(uint index)
675675
{
676-
return IsButtonPressed(index, ButtonPressTypes.Press, SteamVR_Controller.ButtonMask.ApplicationMenu);
676+
return false;
677677
}
678678

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

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

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

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

729729
[RuntimeInitializeOnLoadMethod]

0 commit comments

Comments
 (0)