Move ThumbUp gesture detection into json map file.

This commit is contained in:
1P-Cusack 2017-07-17 10:58:30 -04:00
parent af751c8b8c
commit 7319998df9
2 changed files with 12 additions and 11 deletions

View file

@ -22,6 +22,10 @@
{ "from": "Vive.LeftGrip", "to": "Standard.LeftGrip" },
{ "from": "Vive.LS", "to": "Standard.LS" },
{ "from": "Vive.LSTouch", "to": "Standard.LeftThumbUp",
"peek": true,
"filters": [ { "type": "not" } ]
},
{ "from": "Vive.LSTouch", "to": "Standard.LSTouch" },
{ "from": "Vive.RY", "when": "Vive.RSY", "filters": ["invert"], "to": "Standard.RY" },
@ -36,6 +40,10 @@
{ "from": "Vive.RightGrip", "to": "Standard.RightGrip" },
{ "from": "Vive.RS", "to": "Standard.RS" },
{ "from": "Vive.RSTouch", "to": "Standard.RightThumbUp",
"peek": true,
"filters": [ { "type": "not" } ]
},
{ "from": "Vive.RSTouch", "to": "Standard.RSTouch" },
{ "from": "Vive.LSCenter", "to": "Standard.LeftPrimaryThumb" },
@ -69,8 +77,6 @@
{ "from": "Vive.Head", "to" : "Standard.Head"},
{ "from": "Vive.RightArm", "to" : "Standard.RightArm" },
{ "from": "Vive.LeftArm", "to" : "Standard.LeftArm" },
{ "from": "Vive.LeftThumbUp", "to": "Standard.LeftThumbUp" },
{ "from": "Vive.RightThumbUp", "to": "Standard.RightThumbUp" }
{ "from": "Vive.LeftArm", "to" : "Standard.LeftArm" }
]
}

View file

@ -863,11 +863,9 @@ void ViveControllerManager::InputDevice::handleButtonEvent(float deltaTime, uint
}
}
if (button == vr::k_EButton_SteamVR_Touchpad) {
if (touched) {
_buttonPressedMap.insert(isLeftHand ? LS_TOUCH : RS_TOUCH);
} else {
_buttonPressedMap.insert(isLeftHand ? LEFT_THUMB_UP : RIGHT_THUMB_UP);
if (touched) {
if (button == vr::k_EButton_SteamVR_Touchpad) {
_buttonPressedMap.insert(isLeftHand ? LS_TOUCH : RS_TOUCH);
}
}
}
@ -1172,9 +1170,6 @@ controller::Input::NamedVector ViveControllerManager::InputDevice::getAvailableI
// app button above trackpad.
Input::NamedPair(Input(_deviceID, LEFT_APP_MENU, ChannelType::BUTTON), "LeftApplicationMenu"),
Input::NamedPair(Input(_deviceID, RIGHT_APP_MENU, ChannelType::BUTTON), "RightApplicationMenu"),
makePair(LEFT_THUMB_UP, "LeftThumbUp"),
makePair(RIGHT_THUMB_UP, "RightThumbUp"),
};
return availableInputs;