• I think I'm missing something simple with an app I am writing, and my google / ctrl+f skills are failing me.

    If I create an event-linked callback, like

    Bangle.on('touch', (button, xy) => getTouchedKey(keys, xy, resolve));
    

    Is there some way to clear that callback from triggering on touch? I tried making a call to

    Bangle.on('touch', () => {});
    

    but that seems to just add another callback to the event watcher.

    Basically I am popping up a keyboard that responds to touch events, but when the keyboard promise resolves I want to return to a previous UI state. Instead I end up with an invisible keyboard over the previous UI.

    Happy to either get an answer here or be directed to the appropriate documentation if it's out there!

    EDIT: I may have found what I am looking for? In the documentation for Bangle.setUI there's a quote:

    While you could use setWatch/etc manually, the benefit here is that you don't end up with multiple setWatch instances,

    So maybe I need to just figure out how to do this with setUI and that will resolve my problem.

    EDIT: Yes, that did it. I'd like to thank the community for bearing with me while I talk through my problems out loud, :D

    For posterity:

    Bangle.setUI({
          mode: "custom",
          touch: (button, xy) => getTouchedKey(keys, xy, resolve)
        });
    ... later...
    Bangle.setUI(undefined);
    
About

Avatar for Philip @Philip started