From cdfb4d61cb25861fe83a9953e9cb8be1b5731cd0 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.com> Date: Fri, 1 Nov 2024 21:14:18 +0100 Subject: [PATCH] Bangle_setUI_F18: add `btnRelease` (read below) Explicitly state button should fire on falling edge. Does not change `btn` mapped handlers to act on rising edge just jet. As per suggestion in https://github.com/espruino/Espruino/pull/2571#issuecomment-2426702779. --- libs/js/banglejs/Bangle_setUI_F18.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/js/banglejs/Bangle_setUI_F18.js b/libs/js/banglejs/Bangle_setUI_F18.js index 6c34826247..9ce50f875b 100644 --- a/libs/js/banglejs/Bangle_setUI_F18.js +++ b/libs/js/banglejs/Bangle_setUI_F18.js @@ -69,7 +69,7 @@ Bangle.swipeHandler = options.swipe; Bangle.on("swipe", Bangle.swipeHandler); } - if (options.btn) { + if (options.btn || options.btnRelease) { Bangle.btnWatches = [ setWatch(function() { options.btn(1); }, BTN1, {repeat:1,edge:"falling"}), setWatch(function() { options.btn(2); }, BTN2, {repeat:1,edge:"falling"}),