Bug 1318586 - Adjust OpenVR controller button mapping to be consistency; r=kip
authorDaosheng Mu <daoshengmu@gmail.com>
Fri, 18 Nov 2016 16:36:51 +0800
changeset 324056 809655f44e1988e72f4efb0f7ccb22b64a8f8a4d
parent 324055 36a118cbe8155070604735f80e81088ce1df7828
child 324057 ac16df8810f60d0bd4514b5d4975e63e7004e3ce
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerskip
bugs1318586
milestone53.0a1
Bug 1318586 - Adjust OpenVR controller button mapping to be consistency; r=kip MozReview-Commit-ID: 6ODcMjqYQNP
gfx/vr/gfxVROpenVR.cpp
--- a/gfx/vr/gfxVROpenVR.cpp
+++ b/gfx/vr/gfxVROpenVR.cpp
@@ -55,27 +55,28 @@ static pfn_VR_InitInternal vr_InitIntern
 static pfn_VR_ShutdownInternal vr_ShutdownInternal = nullptr;
 static pfn_VR_IsHmdPresent vr_IsHmdPresent = nullptr;
 static pfn_VR_IsRuntimeInstalled vr_IsRuntimeInstalled = nullptr;
 static pfn_VR_GetStringForHmdError vr_GetStringForHmdError = nullptr;
 static pfn_VR_GetGenericInterface vr_GetGenericInterface = nullptr;
 
 // EButton_System, EButton_DPad_xx, and EButton_A
 // can not be triggered in Steam Vive in OpenVR SDK 1.0.3.
+// Reminder: changing the order of these buttons may break web content.
 const uint64_t gOpenVRButtonMask[] = {
   // vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_System),
-  vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_ApplicationMenu),
+  vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_SteamVR_Touchpad),
+  vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_SteamVR_Trigger),
+  // vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_A),
   vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_Grip),
+  vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_ApplicationMenu)
   // vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_DPad_Left),
   // vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_DPad_Up),
   // vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_DPad_Right),
-  // vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_DPad_Down),
-  // vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_A),
-  vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_SteamVR_Touchpad),
-  vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_SteamVR_Trigger)
+  // vr::ButtonMaskFromId(vr::EVRButtonId::k_EButton_DPad_Down)
 };
 
 const uint32_t gNumOpenVRButtonMask = sizeof(gOpenVRButtonMask) /
                                       sizeof(uint64_t);
 
 enum class VRControllerAxisType : uint16_t {
   TrackpadXAxis,
   TrackpadYAxis,