ctrlpad: implement remaining two buttons: clk & launcher

pull/3383/head
Rob Pilling 2024-04-26 18:43:05 +01:00
parent 09afa44e31
commit 597ee4c08b
1 changed files with 14 additions and 6 deletions

View File

@ -178,10 +178,6 @@
const initUI = () => {
if (ui) return;
function noop(this: Control, tap: boolean) {
return (this.bg === colour.on.bg) !== tap; // on ^ tap
}
const controls: FiveOf<ControlTemplate> = [
{
text: "BLE",
@ -232,8 +228,20 @@
return !off !== tap; // on ^ tap
}
},
{ text: "B-", cb: noop },
{ text: "B+", cb: noop },
{
text: "clk",
cb: tap => {
if (tap) Bangle.showClock(), terminateUI();
return true;
},
},
{
text: "lch",
cb: tap => {
if (tap) Bangle.showLauncher(), terminateUI();
return true;
},
},
];
const overlay = new Overlay();