Add disabling of right click menu with vive

This commit is contained in:
Ryan Huffman 2016-09-02 12:43:56 -07:00
parent eb195e2fb8
commit a4ffa7b23f
2 changed files with 26 additions and 10 deletions

View file

@ -363,7 +363,7 @@ function makeToggleAction(hand) { // return a function(0|1) that makes the speci
};
}
var clickMapping = Controller.newMapping(Script.resolvePath('') + '-click');
var clickMapping = Controller.newMapping('handControllerPointer-click');
Script.scriptEnding.connect(clickMapping.disable);
// Gather the trigger data for smoothing.

View file

@ -837,18 +837,34 @@ function stopTutorial() {
startTutorial();
var DISABLE_SPIN_MAPPING = "com.highfidelity.spin.disable";
var mapping = Controller.newMapping(DISABLE_SPIN_MAPPING);
function noop(value) { }
mapping.from([Controller.Standard.RY]).to(noop);
var TUTORIAL_DISABLE_MAPPING = "com.highfidelity.tutorial.disable";
var mapping = Controller.newMapping(TUTORIAL_DISABLE_MAPPING);
function noop(value) {
print("NOOP");
}
mapping.from([
Controller.Vive.LSCenter,
Controller.Vive.LeftApplicationMenu,
Controller.Standard.LeftSecondaryThumb,
Controller.Standard.LeftPrimraryThumb
]).to(noop);
mapping.from([]).to(noop);
mapping.from([]).to(noop);
Controller.enableMapping(TUTORIAL_DISABLE_MAPPING);
Script.scriptEnding.connect(function() {
Controller.disableMapping(TUTORIAL_DISABLE_MAPPING);
});
Controller.disableMapping('handControllerPointer-click');
//mapping.from([Controller.Standard.RY]).to(noop);
//{ "from": "Vive.LeftApplicationMenu", "to": "Standard.LeftSecondaryThumb" },
//mapping.from([Controller.Standard.RY]).when("Controller.Application.Grounded").to(noop);
//mapping.from([Controller.Standard.RY]).when(Controller.Application.Grounded).to(noop);
Controller.enableMapping(DISABLE_SPIN_MAPPING);
Script.scriptEnding.connect(function() {
Controller.disableMapping(DISABLE_SPIN_MAPPING);
});
Script.scriptEnding.connect(stopTutorial);