diff --git a/static/index_ws.html b/static/index_ws.html index 6b68a677..3b61ebf7 100644 --- a/static/index_ws.html +++ b/static/index_ws.html @@ -68,10 +68,10 @@
- - - - + + + +
diff --git a/static/js/gameboy_controller.js b/static/js/gameboy_controller.js index 5cded038..2da273bb 100644 --- a/static/js/gameboy_controller.js +++ b/static/js/gameboy_controller.js @@ -370,6 +370,8 @@ function checkDPadAxis(bo, axis) { } else { $(`.dpad .${axis}`).removeClass("pressed"); } + + doButton(bo, axis); } } @@ -380,9 +382,9 @@ function createJoystick(parent) { stick.classList.add('joystick'); // TODO: REMOVE MOUSE - parent.on('mousedown', handleMouseDown); - $(document).on('mousemove', handleMouseMove); - $(document).on('mouseup', handleMouseUp); + // parent.on('mousedown', handleMouseDown); + // $(document).on('mousemove', handleMouseMove); + // $(document).on('mouseup', handleMouseUp); parent.on('touchstart', handleMouseDown); parent.on('touchmove', handleMouseMove); @@ -456,16 +458,18 @@ function createJoystick(parent) { function handleButtonDown(event) { $(this).addClass("pressed"); + doButtonDown($(this).attr("value")); } function handleButtonUp(event) { $(this).removeClass("pressed"); + doButtonUp($(this).attr("value")); } // TODO: REMOVE MOUSE -$(".abxy .button").on("mousedown", handleButtonDown); -$(".abxy .button").on("mouseup", handleButtonUp); +// $(".abxy .button").on("mousedown", handleButtonDown); +// $(".abxy .button").on("mouseup", handleButtonUp); $(".abxy .button").on("touchstart", handleButtonDown); $(".abxy .button").on("touchend", handleButtonUp); \ No newline at end of file