rem: socket.emit("controllerButtonEvent", i, val); 
context: function updateStatus(){	if(navigator.webkitGetGamepads){		scangamepads();	}	for(var gamepad in controllers){		var controller = controllers[gamepad];		var d = document.getElementById("controller" + gamepad);		var buttons = d.getElementsByClassName("button");		for(var i=0; i<controller.buttons.length; i++){			var b = buttons[i];			var val = controller.buttons[i];			var pressed = val == 1.0;			if(typeof(val) == "object"){				pressed = val.pressed;				val = val.value;			}			if(pressed){				b.className = "button pressed";			}			else{				b.className = "button";			}			socket.emit("controllerButtonEvent", i, val);		}		var axes = d.getElementsByClassName("axis");		for(var i =0; i < controller.axes.length; i++){			var a = axes[i];			a.innerHTML = i + ": " + controller.axes[i].toFixed(4);			a.setAttribute("value", controller.axes[i] + 1);			socket.emit("controllerAxesEvent", i, a.getAttribute("value"));		}	}	rAF(updateStatus_withTimeOut);}
meta: 10965	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10965/7d0510801dadc75e82b1856b4bf667ba8da0e0bd/BeagleQuadHome.js/clean/code/ControlTower/javascript/BeagleQuadHome.js