Slide 52
Slide 52 text
Visualization of Input Info with Text
const txt = document.getElementById("txt");
//Called when x button begin to be pressed (for Left Hand)
this.el.addEventListener('xbuttondown', function (e) {
txt.setAttribute("value", "x pressed");
});
//Called when x button is released (for Left Hand)
this.el.addEventListener('xbuttonup', function (e) {
txt.setAttribute("value", "x released");
});
//Called when grip button begin to be pressed (for Both Hand)
this.el.addEventListener('gripdown', function (e) {
txt.setAttribute("value", "grip pressed");
});
//Called when grip button released. (for Both Hand)
this.el.addEventListener('gripup', function (e) {
txt.setAttribute("value", "grip released");
}); 4.txt