diff --git a/raspberry/roberto/views/frontend/templates/gamepad.js b/raspberry/roberto/views/frontend/templates/gamepad.js index a882393..113cd03 100644 --- a/raspberry/roberto/views/frontend/templates/gamepad.js +++ b/raspberry/roberto/views/frontend/templates/gamepad.js @@ -109,15 +109,16 @@ var joystick_axes = { joystick.on('move', function(evt, data) { joystick_axes.x1 = data.vector.x; - joystick_axes.y1 = -data.vector.y; + joystick_axes.y2 = -data.vector.y; joystick_axes.moved = true; }); joystick.on('end', function(evt, data) { joystick_axes.x1 = 0; joystick_axes.y1 = 0; joystick_axes.moved = true; + //evt.target.manager.unbindDocument(true); }); - +/* var joystick2 = nipplejs.create({ zone: document.getElementById('controls_r'), mode: 'static', @@ -136,8 +137,16 @@ var joystick_axes = { joystick_axes.x2 = 0; joystick_axes.y2 = 0; joystick_axes.moved = true; + //evt.target.manager.unbindDocument(true); }); - +*/ +/* // fix joysticks get stuck on multitouch (doesn't work) + $(window).on('touchcancel', function(e) { + console.log("touchcancel"); + joystick.processOnEnd(e); + joystick2.processOnEnd(e); + }); +*/ setInterval(function(){ if (joystick_axes.moved) { socket.emit('axes', {0: joystick_axes.x1, 1: joystick_axes.y1, 3: joystick_axes.x2, 4: joystick_axes.y2}); diff --git a/raspberry/roberto/views/frontend/templates/index.html b/raspberry/roberto/views/frontend/templates/index.html index ee1a97f..f1efff3 100644 --- a/raspberry/roberto/views/frontend/templates/index.html +++ b/raspberry/roberto/views/frontend/templates/index.html @@ -272,7 +272,7 @@ function toggleFullScreen() { var goFS = document.getElementById("goFS"); goFS.addEventListener("click", function() { toggleFullScreen(); - document.getElementById("goFS").style.display = "none"; + //document.getElementById("goFS").style.display = "none"; }, false); var goDebug = document.getElementById("goDebug");