Bangle.js emulator and events

Posted on
  • Is it possible to trigger an event in the emulator?

    (I'm playing with code - in a somewhat amateur fashion - until the Bangle.js 2 is shipped; I'm working up to a clock which shows seconds and date for a period when it's tapped, but otherwise only updates each minute).

  • That's a great idea!

    I've been playing a bit with an app as well recently, and I've been using the Bangle touch event successfully in the emulator for both v1 and v2 (if that's what you're asking about).

  • Sun 2021.10.17

    'Is it possible to trigger an event'

    Respond to human input, or an event started from a timer interval?

  • Respond to human input - tap, twist etc.

    (@johan_m_o has mentioned the Touch event, which I can use as a proxy while developing. In real life I'd like it to be a tap as I understand the touch screen is likely to be locked until a button press.)

  • Thanks -- the touch event is something I can use in the emulator, and switch to a tap when the watch is actually here!

  • Tap and twist are probably not gonna work in the emulator no...

  • While not a perfect solution, a simulation of, say a twist event, could be pre-determined/coded such that either a Touch event or as an interval/timeout end occurs, that code block would then execute, emulating the physical event.

    https://www.espruino.com/Reference#l__global_setTimeout
    https://www.espruino.com/Reference#l__global_setInterval

    https://banglejs.com/reference#l_Bangle_tap
    https://banglejs.com/reference#l_Bangle_twist

  • Just a note that for the touch event:

    Bangle.on('touch', function(button, xy) { ... });
    

    You can fake it with:

    Bangle.emit('touch', button, xy);
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle.js emulator and events

Posted by Avatar for daldred @daldred

Actions