From 40bd747080979be5c69f32a8636c601918cce010 Mon Sep 17 00:00:00 2001 From: Sam Gondelman Date: Mon, 15 Jun 2015 11:13:07 -0700 Subject: [PATCH] added trigger buttons to hydra, removed hydraMove.js from default scripts --- examples/defaultScripts.js | 1 - interface/src/devices/SixenseManager.cpp | 6 ++++++ interface/src/devices/SixenseManager.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/examples/defaultScripts.js b/examples/defaultScripts.js index 61bed8d9b1..b5e3e3f551 100644 --- a/examples/defaultScripts.js +++ b/examples/defaultScripts.js @@ -11,7 +11,6 @@ Script.load("progress.js"); Script.load("edit.js"); Script.load("selectAudioDevice.js"); -Script.load("controllers/hydra/hydraMove.js"); Script.load("inspect.js"); Script.load("lobby.js"); Script.load("notifications.js"); diff --git a/interface/src/devices/SixenseManager.cpp b/interface/src/devices/SixenseManager.cpp index 3927850a44..18c7365ef8 100644 --- a/interface/src/devices/SixenseManager.cpp +++ b/interface/src/devices/SixenseManager.cpp @@ -645,6 +645,9 @@ void SixenseManager::handleButtonEvent(unsigned int buttons, int index) { if (buttons & BUTTON_FWD) { _buttonPressedMap.insert(makeInput(BUTTON_FWD, index).getChannel()); } + if (buttons & BUTTON_TRIGGER) { + _buttonPressedMap.insert(makeInput(BUTTON_TRIGGER, index).getChannel()); + } } void SixenseManager::registerToUserInputMapper(UserInputMapper& mapper) { @@ -669,6 +672,7 @@ void SixenseManager::registerToUserInputMapper(UserInputMapper& mapper) { availableInputs.append(UserInputMapper::InputPair(makeInput(AXIS_Y_NEG, 0), "Left Stick Down")); availableInputs.append(UserInputMapper::InputPair(makeInput(AXIS_X_POS, 0), "Left Stick Right")); availableInputs.append(UserInputMapper::InputPair(makeInput(AXIS_X_NEG, 0), "Left Stick Left")); + availableInputs.append(UserInputMapper::InputPair(makeInput(BUTTON_TRIGGER, 0), "Left Trigger Press")); availableInputs.append(UserInputMapper::InputPair(makeInput(BUTTON_0, 1), "Right Start")); availableInputs.append(UserInputMapper::InputPair(makeInput(BUTTON_1, 1), "Right Button 1")); @@ -683,6 +687,8 @@ void SixenseManager::registerToUserInputMapper(UserInputMapper& mapper) { availableInputs.append(UserInputMapper::InputPair(makeInput(AXIS_Y_NEG, 1), "Right Stick Down")); availableInputs.append(UserInputMapper::InputPair(makeInput(AXIS_X_POS, 1), "Right Stick Right")); availableInputs.append(UserInputMapper::InputPair(makeInput(AXIS_X_NEG, 1), "Right Stick Left")); + availableInputs.append(UserInputMapper::InputPair(makeInput(BUTTON_TRIGGER, 1), "Right Trigger Press")); + return availableInputs; }; proxy->resetDeviceBindings = [this, &mapper] () -> bool { diff --git a/interface/src/devices/SixenseManager.h b/interface/src/devices/SixenseManager.h index 63aa8846ec..92cc0742d6 100644 --- a/interface/src/devices/SixenseManager.h +++ b/interface/src/devices/SixenseManager.h @@ -36,6 +36,7 @@ const unsigned int BUTTON_2 = 1U << 6; const unsigned int BUTTON_3 = 1U << 3; const unsigned int BUTTON_4 = 1U << 4; const unsigned int BUTTON_FWD = 1U << 7; +const unsigned int BUTTON_TRIGGER = 1U << 8; // Event type that represents using the controller const unsigned int CONTROLLER_0_EVENT = 1500U;