mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 14:12:50 +02:00
Fixing menu navigation in oculus remote
This commit is contained in:
parent
a58a627fdf
commit
2f28c64edb
2 changed files with 15 additions and 14 deletions
|
@ -1,9 +1,8 @@
|
|||
{
|
||||
"name": "Oculus Remote to Standard",
|
||||
"channels": [
|
||||
{ "from": "OculusRemote.Back", "to": "Standard.Back" },
|
||||
{ "from": "OculusRemote.Start", "to": "Standard.Start" },
|
||||
|
||||
{ "from": "OculusRemote.Start", "to": "Actions.UiNavSelect" },
|
||||
{ "from": "OculusRemote.Back", "to": "Actions.UiNavBack" },
|
||||
{ "from": "OculusRemote.DU", "to": "Standard.DU" },
|
||||
{ "from": "OculusRemote.DD", "to": "Standard.DD" },
|
||||
{ "from": "OculusRemote.DL", "to": "Standard.DL" },
|
||||
|
|
|
@ -44,13 +44,16 @@ bool OculusControllerManager::activate() {
|
|||
|
||||
// register with UserInputMapper
|
||||
auto userInputMapper = DependencyManager::get<controller::UserInputMapper>();
|
||||
_remote = std::make_shared<RemoteDevice>(*this);
|
||||
userInputMapper->registerDevice(_remote);
|
||||
|
||||
#if 0
|
||||
_touch = std::make_shared<TouchDevice>();
|
||||
userInputMapper->registerDevice(_touch);
|
||||
#endif
|
||||
if (OVR_SUCCESS(ovr_GetInputState(_session, ovrControllerType_Remote, &_inputState))) {
|
||||
_remote = std::make_shared<RemoteDevice>(*this);
|
||||
userInputMapper->registerDevice(_remote);
|
||||
}
|
||||
|
||||
if (OVR_SUCCESS(ovr_GetInputState(_session, ovrControllerType_Touch, &_inputState))) {
|
||||
_touch = std::make_shared<TouchDevice>(*this);
|
||||
userInputMapper->registerDevice(_touch);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -76,7 +79,6 @@ void OculusControllerManager::deactivate() {
|
|||
void OculusControllerManager::pluginUpdate(float deltaTime, const controller::InputCalibrationData& inputCalibrationData, bool jointsCaptured) {
|
||||
PerformanceTimer perfTimer("OculusControllerManager::TouchDevice::update");
|
||||
|
||||
|
||||
if (_touch) {
|
||||
if (OVR_SUCCESS(ovr_GetInputState(_session, ovrControllerType_Touch, &_inputState))) {
|
||||
_touch->update(deltaTime, inputCalibrationData, jointsCaptured);
|
||||
|
@ -141,10 +143,10 @@ static const std::vector<std::pair<ovrTouch, StandardButtonChannel>> TOUCH_MAP {
|
|||
controller::Input::NamedVector OculusControllerManager::RemoteDevice::getAvailableInputs() const {
|
||||
using namespace controller;
|
||||
QVector<Input::NamedPair> availableInputs {
|
||||
makePair(DU, "Up"),
|
||||
makePair(DD, "Down"),
|
||||
makePair(DL, "Left"),
|
||||
makePair(DR, "Right"),
|
||||
makePair(DU, "DU"),
|
||||
makePair(DD, "DD"),
|
||||
makePair(DL, "DL"),
|
||||
makePair(DR, "DR"),
|
||||
makePair(START, "Start"),
|
||||
makePair(BACK, "Back"),
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue