lightswitch: tap-to-lock setting
parent
1a97f2bf41
commit
fe9572bdbe
|
|
@ -51,6 +51,8 @@ All touch and drag inputs related to this widget are cached/masked to prevent ac
|
||||||
* __Min Value__
|
* __Min Value__
|
||||||
_1%_ / _2%_ / _..._ / __10%__ / _..._ / _100%_
|
_1%_ / _2%_ / _..._ / __10%__ / _..._ / _100%_
|
||||||
Set the minimal level of brightness you can change to.
|
Set the minimal level of brightness you can change to.
|
||||||
|
* __Tap to lock__
|
||||||
|
Tapping the widget locks the screen, rather than toggling brightness.
|
||||||
|
|
||||||
#### Unlock - Set double tap side to unlock:
|
#### Unlock - Set double tap side to unlock:
|
||||||
* __TapSide__
|
* __TapSide__
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
oversize: 20,
|
oversize: 20,
|
||||||
dragDelay: 500,
|
dragDelay: 500,
|
||||||
minValue: 0.1,
|
minValue: 0.1,
|
||||||
|
tapToLock: false,
|
||||||
unlockSide: "",
|
unlockSide: "",
|
||||||
tapSide: "right",
|
tapSide: "right",
|
||||||
tapOn: "always",
|
tapOn: "always",
|
||||||
|
|
@ -119,6 +120,11 @@
|
||||||
max: 100,
|
max: 100,
|
||||||
step: 1
|
step: 1
|
||||||
},
|
},
|
||||||
|
tapToLock: {
|
||||||
|
title: ["on", "off"],
|
||||||
|
value: [true, false],
|
||||||
|
drawWidgets: false
|
||||||
|
},
|
||||||
unlockSide: {
|
unlockSide: {
|
||||||
title: ["off", "left", "right", "top", "bottom", "front", "back"],
|
title: ["off", "left", "right", "top", "bottom", "front", "back"],
|
||||||
value: ["", "left", "right", "top", "bottom", "front", "back"]
|
value: ["", "left", "right", "top", "bottom", "front", "back"]
|
||||||
|
|
@ -154,6 +160,7 @@
|
||||||
"Oversize": getEntry("oversize"),
|
"Oversize": getEntry("oversize"),
|
||||||
"Drag Delay": getEntry("dragDelay"),
|
"Drag Delay": getEntry("dragDelay"),
|
||||||
"Min Value": getEntry("minValue"),
|
"Min Value": getEntry("minValue"),
|
||||||
|
"Tap to lock": getEntry("tapToLock"),
|
||||||
"-- Unlock": 0,
|
"-- Unlock": 0,
|
||||||
"TapSide": getEntry("unlockSide"),
|
"TapSide": getEntry("unlockSide"),
|
||||||
"-- Flash": 0,
|
"-- Flash": 0,
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
oversize: 20,
|
oversize: 20,
|
||||||
dragDelay: 500,
|
dragDelay: 500,
|
||||||
minValue: 0.1,
|
minValue: 0.1,
|
||||||
|
tapToLock: false,
|
||||||
unlockSide: "",
|
unlockSide: "",
|
||||||
tapSide: "right",
|
tapSide: "right",
|
||||||
tapOn: "always",
|
tapOn: "always",
|
||||||
|
|
@ -208,8 +209,12 @@
|
||||||
w.dragStatus = "off";
|
w.dragStatus = "off";
|
||||||
}, w.dragDelay, w);
|
}, w.dragDelay, w);
|
||||||
}
|
}
|
||||||
// switch backlight
|
if (w.tapToLock) {
|
||||||
w.changeValue();
|
Bangle.setLocked(true);
|
||||||
|
} else {
|
||||||
|
// switch backlight
|
||||||
|
w.changeValue();
|
||||||
|
}
|
||||||
// masks this touch event by messing up the event handler
|
// masks this touch event by messing up the event handler
|
||||||
// see https://github.com/espruino/Espruino/issues/2151
|
// see https://github.com/espruino/Espruino/issues/2151
|
||||||
Bangle.removeListener("touch", w.touchListener);
|
Bangle.removeListener("touch", w.touchListener);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue