function init(){
gamepad.addEventListener("touchstart", function(e){buttonStart(e)});
gamepad.addEventListener("touchend", function(e){buttonEnd(e)});
}
function buttonStart(e){
var cX = e.touches[0].pageX;
if(cX > 0 || cX < 32){
//Active Button A
}
if(cX > 100 || cX < 132){
//Active Button B
}
}
function buttonEnd(e){
//Disable button
}.<div id="gamepad" style="position:absolute;bottom:25%;left:0px;background-color:green;height: 25%;width: 100%;">