From 71356dc47a89d0daa1516401db48b07aca89f8e5 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 4 Aug 2020 15:26:51 +0200 Subject: [PATCH] joystick event --- raspberry/roberto/views/frontend/templates/gamepad.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/raspberry/roberto/views/frontend/templates/gamepad.js b/raspberry/roberto/views/frontend/templates/gamepad.js index f189048..ee6cf22 100644 --- a/raspberry/roberto/views/frontend/templates/gamepad.js +++ b/raspberry/roberto/views/frontend/templates/gamepad.js @@ -98,9 +98,14 @@ if (haveEvents) { var joystick = nipplejs.create({ zone: document.getElementById('controls'), mode: 'static', + //catchDistance: 150, position: {left: '50%', top: '50%'}, color: 'blue' }); + + joystick.on('move', function(evt, data) { + console.log(data); + }); /* setInterval(function(){ if (joystick) {