From f38303a9a5890c6fa75a73d776089dabd4b2d27e Mon Sep 17 00:00:00 2001 From: Brad Davis Date: Mon, 26 Oct 2015 10:36:31 -0700 Subject: [PATCH] Adding vive default mapping --- interface/resources/controllers/vive.json | 22 +++++++++++++++++++ .../input-plugins/ViveControllerManager.cpp | 4 ++-- 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 interface/resources/controllers/vive.json diff --git a/interface/resources/controllers/vive.json b/interface/resources/controllers/vive.json new file mode 100644 index 0000000000..f51f908813 --- /dev/null +++ b/interface/resources/controllers/vive.json @@ -0,0 +1,22 @@ +{ + "name": "XBox to Standard", + "channels": [ + { "from": "Vive.LY", "to": "Standard.LY" }, + { "from": "Vive.LX", "to": "Standard.LX" }, + { "from": "Vive.LT", "to": "Standard.LT" }, + { "from": "Vive.LB", "to": "Standard.LB" }, + { "from": "Vive.LS", "to": "Standard.LS" }, + + { "from": "Vive.RY", "to": "Standard.RY" }, + { "from": "Vive.RX", "to": "Standard.RX" }, + { "from": "Vive.RT", "to": "Standard.RT" }, + { "from": "Vive.RB", "to": "Standard.RB" }, + { "from": "Vive.RS", "to": "Standard.RS" }, + + { "from": "Vive.Back", "to": "Standard.Back" }, + { "from": "Vive.Start", "to": "Standard.Start" }, + + { "from": "Vive.A", "to": "Standard.A" }, + { "from": "Vive.B", "to": "Standard.B" } + ] +} diff --git a/libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp b/libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp index 21b7b81173..8dd3d21a07 100644 --- a/libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp +++ b/libraries/input-plugins/src/input-plugins/ViveControllerManager.cpp @@ -45,7 +45,7 @@ const QString MENU_PATH = MENU_PARENT + ">" + MENU_NAME; const QString RENDER_CONTROLLERS = "Render Hand Controllers"; ViveControllerManager::ViveControllerManager() : - InputDevice("SteamVR Controller"), + InputDevice("Vive"), _trackedControllers(0), _modelLoaded(false), _leftHandRenderID(0), @@ -313,7 +313,7 @@ void ViveControllerManager::handleButtonEvent(uint32_t button, bool pressed, boo if (button == vr::k_EButton_ApplicationMenu) { // FIXME? - _buttonPressedMap.insert(left ? controller::A : controller::A); + _buttonPressedMap.insert(left ? controller::B : controller::A); } else if (button == vr::k_EButton_Grip) { // Tony says these are harder to reach, so make them the meta buttons _buttonPressedMap.insert(left ? controller::BACK : controller::START);