diff --git a/libraries/input-plugins/src/input-plugins/StandardController.cpp b/libraries/input-plugins/src/input-plugins/StandardController.cpp index ba5b5baa19..4fb4a23654 100644 --- a/libraries/input-plugins/src/input-plugins/StandardController.cpp +++ b/libraries/input-plugins/src/input-plugins/StandardController.cpp @@ -2,8 +2,8 @@ // StandardController.cpp // input-plugins/src/input-plugins // -// Created by Stephen Birarda on 2014-09-23. -// Copyright 2014 High Fidelity, Inc. +// Created by Brad Hefta-Gaub on 2015-10-11. +// Copyright 2015 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -68,6 +68,9 @@ void StandardController::registerToUserInputMapper(UserInputMapper& mapper) { availableInputs.append(UserInputMapper::InputPair(makeInput(RIGHT_AXIS_X_POS), "Right Stick Right")); availableInputs.append(UserInputMapper::InputPair(makeInput(RIGHT_AXIS_X_NEG), "Right Stick Left")); + availableInputs.append(UserInputMapper::InputPair(makeInput(LEFT_HAND), "Left Hand")); + availableInputs.append(UserInputMapper::InputPair(makeInput(RIGHT_HAND), "Right Hand")); + return availableInputs; }; proxy->resetDeviceBindings = [this, &mapper] () -> bool { @@ -154,3 +157,6 @@ UserInputMapper::Input StandardController::makeInput(StandardController::Standar return UserInputMapper::Input(_deviceID, axis, UserInputMapper::ChannelType::AXIS); } +UserInputMapper::Input StandardController::makeInput(StandardController::StandardControllerPoseChannel pose) { + return UserInputMapper::Input(_deviceID, pose, UserInputMapper::ChannelType::POSE); +} diff --git a/libraries/input-plugins/src/input-plugins/StandardController.h b/libraries/input-plugins/src/input-plugins/StandardController.h index ac89bca581..7f13b61783 100644 --- a/libraries/input-plugins/src/input-plugins/StandardController.h +++ b/libraries/input-plugins/src/input-plugins/StandardController.h @@ -2,8 +2,8 @@ // StandardController.h // input-plugins/src/input-plugins // -// Created by Stephen Birarda on 2014-09-23. -// Copyright 2014 High Fidelity, Inc. +// Created by Brad Hefta-Gaub on 2015-10-11. +// Copyright 2015 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -49,6 +49,11 @@ public: STANDARD_CONTROLLER_BUTTON_RIGHTSHOULDER, }; + enum StandardControllerPoseChannel { + LEFT_HAND = 0, + RIGHT_HAND, + }; + const QString& getName() const { return _name; } // Device functions @@ -62,6 +67,7 @@ public: UserInputMapper::Input makeInput(StandardController::StandardControllerButtonChannel button); UserInputMapper::Input makeInput(StandardController::StandardControllerAxisChannel axis); + UserInputMapper::Input makeInput(StandardController::StandardControllerPoseChannel pose); private: };