AddEventListener
addEventListener()
is a common BrightSign method that is used to listen for an event.
...
Code Block |
---|
|
target.addEventListener(type, listener); |
RemoveEventListener
...
Code Block |
---|
|
target.removeEventListener(type, listener); |
Example
Code Block |
---|
|
function GPIOcontrolDown(msg){
console.log(JSON.stringify(msg));
console.log(" GPIO : " + msg.detail)
}
// to add an event listener for the "controldown" GPIO event
control_port.addEventListener("controldown", GPIOcontrolDown);
// to remove the "controldown" GPIO event listener
control_port.removeEventListener("controldown", GPIOcontrolDown); |
...