One thing you might be hitting is the timeout is a 32 bit integer, and 99999999999 is greater than can be stored in an int. If you want to disable the lock timeout, just use 0
However if you leave the watch unlocked the touchscreen stays on which draws a lot of power - it'll run the Bangle's battery down in about a week.
If the device is locked or the screen is off, the button event that unlocks the screen gets 'eaten', because in most cases you don't want a button press to (for instance) immediately start the launcher.
What I'd suggest is you just respond to the watch being unlocked as well as handling the button press:
On 2v20 (when released) or cutting edge firmwares you can even go one further and ensure that the watch can be woken up by other things (like twisting) but only a button press fires your function:
Bangle.on("lock", (locked,reason) => {
if (!locked && reason=="button") buttonPressed();
});
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
One thing you might be hitting is the timeout is a 32 bit integer, and 99999999999 is greater than can be stored in an int. If you want to disable the lock timeout, just use
0
However if you leave the watch unlocked the touchscreen stays on which draws a lot of power - it'll run the Bangle's battery down in about a week.
If the device is locked or the screen is off, the button event that unlocks the screen gets 'eaten', because in most cases you don't want a button press to (for instance) immediately start the launcher.
What I'd suggest is you just respond to the watch being unlocked as well as handling the button press:
On 2v20 (when released) or cutting edge firmwares you can even go one further and ensure that the watch can be woken up by other things (like twisting) but only a button press fires your function: