From fbe14a79d1aa096ba3c2bb891a918f5ffc896885 Mon Sep 17 00:00:00 2001 From: Mika Dede Date: Sun, 3 Oct 2021 15:39:07 +0200 Subject: [PATCH] score: fix scrolling on b2, change b2 detection --- apps/score/score.app.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/score/score.app.js b/apps/score/score.app.js index 8e1535f86..24e49fa66 100644 --- a/apps/score/score.app.js +++ b/apps/score/score.app.js @@ -29,15 +29,11 @@ function getSecondsTime() { } function setupInputWatchers() { - if (global.BTN4) { - setWatch(() => handleInput(2), BTN2, { repeat: true }); - setWatch(() => handleInput(0), BTN1, { repeat: true }); - setWatch(() => handleInput(1), BTN3, { repeat: true }); - } else { - setWatch(() => handleInput(2), BTN, { repeat: true }); - } + isBangle1 = !!global.BTN4; + setWatch(() => handleInput(2), isBangle1 != null ? BTN2 : BTN, { repeat: true }); + Bangle.setUI('updown', v => v && handleInput(Math.floor((v+2)/2)+(isBangle1 ? 0 : 3))); Bangle.on('touch', (b, e) => { - if (b) { + if (isBangle1) { if (b === 1) { handleInput(3); } else {