Showing the changes to examples/example/scripts/controllerScriptingExamples.js (1 of 5 files). Show all
Unified · Split
| @@ -23,17 +23,21 @@ function findAction(name) { · 22 unmodified lines | ||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| 26 | −var hydra = Controller.Hardware.Hydra2; | |
| 26 | +var hydra = Controller.Hardware.Hydra; | |
| 27 | 27 | if (hydra !== undefined) { |
| 28 | 28 | print("-----------------------------------"); |
| 29 | − var mapping = NewControllers.newMapping("Default"); | |
| 29 | + var mapping = Controller.newMapping("Test"); | |
| 30 | 30 | var standard = Controller.Standard; |
| 31 | 31 | print("standard:" + standard); |
| 32 | − mapping.from(hydra.LeftButton1).to(standard.A); | |
| 33 | − mapping.from(hydra.LeftButton2).to(standard.B); | |
| 34 | − mapping.from(hydra.LeftButton3).to(standard.X); | |
| 35 | − NewControllers.enableMapping("Default"); | |
| 32 | + mapping.from(hydra.L1).to(standard.A); | |
| 33 | + mapping.from(hydra.L2).to(standard.B); | |
| 34 | + mapping.from(hydra.L3).to(function (newValue, oldValue, source) { | |
| 35 | + print("hydra.L3 newValue:" + newValue + ", oldValue:" + oldValue + ", source:" + source); | |
| 36 | + }); | |
| 37 | + Controller.enableMapping("Test"); | |
| 36 | 38 | print("-----------------------------------"); |
| 39 | +} else { | |
| 40 | + print("couldn't find hydra"); | |
| 37 | 41 | } |
| 38 | 42 | |
| 39 | 43 | Object.keys(Controller.Standard).forEach(function (input) { |