From 1312901f0657c3545a7024c9d9d21704212d57e6 Mon Sep 17 00:00:00 2001
From: Brad Davis <bdavis@saintandreas.org>
Date: Tue, 8 Mar 2016 12:42:24 -0800
Subject: [PATCH] Removing thumb mappings, using start/back for camera and menu

---
 interface/resources/controllers/hydra.json            |  6 +++---
 interface/resources/controllers/standard.json         | 11 +++--------
 .../resources/controllers/standard_navigation.json    |  2 +-
 interface/resources/controllers/vive.json             |  6 ++----
 plugins/openvr/src/ViveControllerManager.cpp          |  8 +++-----
 5 files changed, 12 insertions(+), 21 deletions(-)

diff --git a/interface/resources/controllers/hydra.json b/interface/resources/controllers/hydra.json
index 0193612d27..42237033af 100644
--- a/interface/resources/controllers/hydra.json
+++ b/interface/resources/controllers/hydra.json
@@ -13,11 +13,11 @@
         { "from": "Hydra.RB", "to": "Standard.RB" }, 
         { "from": "Hydra.RS", "to": "Standard.RS" },
 
-        { "from": [ "Hydra.L1", "Hydra.L2", "Hydra.L3", "Hydra.L4" ], "to": "Standard.LeftPrimaryThumb" },
-        { "from": [ "Hydra.L0" ], "to": "Standard.LeftSecondaryThumb" },
+        { "from": "Hydra.L0", "to": "Standard.Back" },
+        { "from": "Hydra.R0", "to": "Standard.Start" },
 
+        { "from": [ "Hydra.L1", "Hydra.L2", "Hydra.L3", "Hydra.L4" ], "to": "Standard.LeftPrimaryThumb" },
         { "from": [ "Hydra.R1", "Hydra.R2", "Hydra.R3", "Hydra.R4" ], "to": "Standard.RightPrimaryThumb" },
-        { "from": [ "Hydra.R0" ], "to": "Standard.RightSecondaryThumb" },
 
         { "from": "Hydra.LeftHand", "to": "Standard.LeftHand" }, 
         { "from": "Hydra.RightHand", "to": "Standard.RightHand" }
diff --git a/interface/resources/controllers/standard.json b/interface/resources/controllers/standard.json
index 135fe81df7..f25e0cc3c4 100644
--- a/interface/resources/controllers/standard.json
+++ b/interface/resources/controllers/standard.json
@@ -27,16 +27,11 @@
 
         { "from": "Standard.RY", "to": "Actions.Up", "filters": "invert"}, 
 
+        { "from": "Standard.Back", "to": "Actions.CycleCamera" },
+        { "from": "Standard.Start", "to": "Actions.ContextMenu" },
+
         { "from": [ "Standard.DU", "Standard.DL", "Standard.DR", "Standard.DD" ], "to": "Standard.LeftPrimaryThumb" },
-        { "from": "Standard.Back", "to": "Standard.LeftSecondaryThumb" },
-
         { "from": [ "Standard.A", "Standard.B", "Standard.X", "Standard.Y" ], "to": "Standard.RightPrimaryThumb" },
-        { "from": "Standard.Start", "to": "Standard.RightSecondaryThumb" },
-
-        { "from": "Standard.LeftPrimaryThumb", "to": "Actions.CycleCamera" }, 
-        { "from": "Standard.LeftSecondaryThumb", "to": "Actions.CycleCamera" }, 
-        { "from": "Standard.RightPrimaryThumb", "to": "Actions.ContextMenu" },
-        { "from": "Standard.RightSecondaryThumb", "to": "Actions.ContextMenu" },
 
         { "from": "Standard.LT", "to": "Actions.LeftHandClick" }, 
         { "from": "Standard.RT", "to": "Actions.RightHandClick" },
diff --git a/interface/resources/controllers/standard_navigation.json b/interface/resources/controllers/standard_navigation.json
index 208970f030..62c0883142 100644
--- a/interface/resources/controllers/standard_navigation.json
+++ b/interface/resources/controllers/standard_navigation.json
@@ -12,7 +12,7 @@
         { "from": "Standard.LB", "to": "Actions.UiNavGroup","filters": "invert" },
         { "from": "Standard.RB", "to": "Actions.UiNavGroup" },
         { "from": [ "Standard.A", "Standard.X" ], "to": "Actions.UiNavSelect" },
-        { "from": [ "Standard.B", "Standard.Y", "Standard.RightPrimaryThumb", "Standard.LeftPrimaryThumb" ], "to": "Actions.UiNavBack" },
+        { "from": [ "Standard.B", "Standard.Y" ], "to": "Actions.UiNavBack" },
         { 
             "from": [ "Standard.RT", "Standard.LT" ], 
             "to": "Actions.UiNavSelect", 
diff --git a/interface/resources/controllers/vive.json b/interface/resources/controllers/vive.json
index c46bcd9402..62602ee36d 100644
--- a/interface/resources/controllers/vive.json
+++ b/interface/resources/controllers/vive.json
@@ -15,10 +15,8 @@
         { "from": "Vive.RB", "to": "Standard.RB" },
         { "from": "Vive.RS", "to": "Standard.RS" },
 
-        { "from": "Vive.LeftPrimaryThumb", "to": "Standard.LeftPrimaryThumb" },
-        { "from": "Vive.RightPrimaryThumb", "to": "Standard.RightPrimaryThumb" },
-        { "from": "Vive.LeftSecondaryThumb", "to": "Standard.LeftSecondaryThumb" },
-        { "from": "Vive.RightSecondaryThumb", "to": "Standard.RightSecondaryThumb" },
+        { "from": "Vive.Back", "to": "Standard.Back" },
+        { "from": "Vive.Start", "to": "Standard.Start" },
 
         { "from": "Vive.LeftHand", "to": "Standard.LeftHand" },
         { "from": "Vive.RightHand", "to": "Standard.RightHand" }
diff --git a/plugins/openvr/src/ViveControllerManager.cpp b/plugins/openvr/src/ViveControllerManager.cpp
index 0de8f6891d..be3f3adc92 100644
--- a/plugins/openvr/src/ViveControllerManager.cpp
+++ b/plugins/openvr/src/ViveControllerManager.cpp
@@ -311,7 +311,7 @@ void ViveControllerManager::InputDevice::handleButtonEvent(float deltaTime, uint
 
     using namespace controller;
     if (button == vr::k_EButton_ApplicationMenu) {
-        _buttonPressedMap.insert(isLeftHand ? LEFT_PRIMARY_THUMB : RIGHT_PRIMARY_THUMB);
+        _buttonPressedMap.insert(isLeftHand ? BACK : START);
     } else if (button == vr::k_EButton_Grip) {
         _buttonPressedMap.insert(isLeftHand ? LB : RB);
     } else if (button == vr::k_EButton_SteamVR_Trigger) {
@@ -426,10 +426,8 @@ controller::Input::NamedVector ViveControllerManager::InputDevice::getAvailableI
         makePair(LEFT_HAND, "LeftHand"),
         makePair(RIGHT_HAND, "RightHand"),
 
-        makePair(LEFT_PRIMARY_THUMB, "LeftPrimaryThumb"),
-        makePair(LEFT_SECONDARY_THUMB, "LeftSecondaryThumb"),
-        makePair(RIGHT_PRIMARY_THUMB, "RightPrimaryThumb"),
-        makePair(RIGHT_SECONDARY_THUMB, "RightSecondaryThumb"),
+        makePair(BACK, "Back"),
+        makePair(START, "Start"),
     };
 
     //availableInputs.append(Input::NamedPair(makeInput(BUTTON_A, 0), "Left Button A"));