CR feedback

This commit is contained in:
Brad Hefta-Gaub 2015-10-11 15:15:20 -07:00
parent 9667a103aa
commit 312bbf6167
2 changed files with 16 additions and 4 deletions

View file

@ -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);
}

View file

@ -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:
};