Merge pull request #3480 from thyttan/delaylock
delaylock: delay lock 5 sec after backlight offmaster
commit
4ca5707c56
|
|
@ -0,0 +1 @@
|
|||
0.01: New App!
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
# Delayed Locking
|
||||
|
||||
Delay the locking of the touchscreen to 5 seconds after the backlight turns off. Giving you the chance to interact with the watch without having to press the hardware button again.
|
||||
|
||||
## Usage
|
||||
|
||||
Just install and the behavior is tweaked at boot time.
|
||||
|
||||
## Features
|
||||
|
||||
- respects the LCD Timeout and Brightness as configured in the settings app.
|
||||
|
||||
## Requests
|
||||
|
||||
Tag @thyttan in an issue to https://gitbub.com/espruino/BangleApps/issues to report problems or suggestions.
|
||||
|
||||
## Creator
|
||||
|
||||
thyttan
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
Inspired by the conversation between Gordon Williams and user156427 linked here: https://forum.espruino.com/conversations/392219/
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
let backlightTimeout = Bangle.getOptions().backlightTimeout;
|
||||
let brightness = require("Storage").readJSON("setting.json", true);
|
||||
brightness = brightness?brightness.brightness:1;
|
||||
|
||||
Bangle.setOptions({
|
||||
backlightTimeout: backlightTimeout,
|
||||
lockTimeout: backlightTimeout+5000
|
||||
});
|
||||
|
||||
let turnLightsOn = (_,numOrObj)=>{
|
||||
if (!Bangle.isBacklightOn()) {
|
||||
Bangle.setLCDPower(brightness);
|
||||
if (typeof numOrObj !== "number") E.stopEventPropagation(); // Touches will not be passed on to other listeners, but swipes will.
|
||||
}
|
||||
};
|
||||
|
||||
setWatch(turnLightsOn, BTN1, { repeat: true, edge: 'rising' });
|
||||
Bangle.prependListener("swipe", turnLightsOn);
|
||||
Bangle.prependListener("touch", turnLightsOn);
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{ "id": "delaylock",
|
||||
"name": "Delayed Locking",
|
||||
"version":"0.01",
|
||||
"description": "Delay the locking of the screen to 5 seconds after the backlight turns off.",
|
||||
"icon": "app.png",
|
||||
"tags": "settings, configuration, backlight, touchscreen, screen",
|
||||
"type": "bootloader",
|
||||
"supports" : ["BANGLEJS2"],
|
||||
"readme": "README.md",
|
||||
"storage": [
|
||||
{"name":"delaylock.boot.js","url":"boot.js"}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue