promenu: pull out touch handler
parent
7b5a7afb06
commit
febeda3375
|
|
@ -257,6 +257,13 @@ E.showMenu = ((items?: Menu): MenuInstance | void => {
|
||||||
else l.select(evt);
|
else l.select(evt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const touchcb = ((_button, xy) => {
|
||||||
|
// since we've specified options.touch,
|
||||||
|
// we need to pass through all taps since the default
|
||||||
|
// touchHandler isn't installed in setUI
|
||||||
|
cb(void 0, xy);
|
||||||
|
}) satisfies TouchCallback;
|
||||||
|
|
||||||
Bangle.setUI({
|
Bangle.setUI({
|
||||||
mode: "updown",
|
mode: "updown",
|
||||||
back: back as () => void,
|
back: back as () => void,
|
||||||
|
|
@ -265,12 +272,7 @@ E.showMenu = ((items?: Menu): MenuInstance | void => {
|
||||||
Bangle.removeListener("swipe", onSwipe);
|
Bangle.removeListener("swipe", onSwipe);
|
||||||
options.remove?.();
|
options.remove?.();
|
||||||
},
|
},
|
||||||
touch: ((_button, xy) => {
|
touch: touchcb,
|
||||||
// since we've specified options.touch,
|
|
||||||
// we need to pass through all taps since the default
|
|
||||||
// touchHandler isn't installed in setUI
|
|
||||||
cb(void 0, xy);
|
|
||||||
}) satisfies TouchCallback,
|
|
||||||
} as SetUIArg<"updown">, cb);
|
} as SetUIArg<"updown">, cb);
|
||||||
|
|
||||||
return l;
|
return l;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue