我创建了一个js脚本,它订阅了两个不同的事件:
function testDoubleEvents() {
alert("started");
var eventName1 = "LeftBumperPressed";
var eventName2 = "RightBumperPressed";
session.service("ALMemory").done(function (ALMemory) {
alert("ALMemory ok");
ALMemory.subscriber(eventName1).done(function(subscriber1) {
alert("subscribed1");
subscriber1.signal.connect(function(result1){
alert(eventName1);
});
});
ALMemory.subscriber(eventName2).done(function(subscriber2) {
alert("subscribed2");
subscriber2.signal.connect(function(result2){
alert(eventName2);
});
});
});
}