Move interactions inside setUI

pull/2243/head
thyttan 2022-11-07 18:37:49 +01:00 committed by GitHub
parent 02f91e1bd0
commit ac60c9cc11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -13,12 +13,14 @@ Bangle.setLCDTimeout(0);
g.reset();
g.setColor(settings.bg);
g.fillRect(0,0,g.getWidth(),g.getHeight());
// Any button turns off
setWatch(()=>load(), BTN1);
if (global.BTN2) setWatch(()=>load(), BTN2);
if (global.BTN3) setWatch(()=>load(), BTN3);
// Pressing upper left corner turns off (where red back button would be)
Bangle.setUI({
mode : 'custom',
back : load
back : load, // B2: Clicking the hardware button or pressing upper left corner turns off (where red back button would be)
btn : (n)=>{ // B1: Any button turns off
if (process.env.HWVERSION==1) {
setWatch(()=>load(), BTN1);
setWatch(()=>load(), BTN2);
setWatch(()=>load(), BTN3);
}
},
});