forked from Blendman974/faceclaw
Merge branch 'main' of https://github.com/jimrandomh/faceclaw
This commit is contained in:
commit
dcb071621d
5 files changed
+31
-10
No files matched your search
@@ -3,6 +3,7 @@
|
|||||||
## 0.7.1 - Unreleased
|
## 0.7.1 - Unreleased
|
||||||
|
|
||||||
* Add Wear OS watch battery indicator to the top bar and Glanceboard
|
* Add Wear OS watch battery indicator to the top bar and Glanceboard
|
||||||
|
* Glanceboard tap setting includes a Disable option
|
||||||
* Refinements to builtin games
|
* Refinements to builtin games
|
||||||
|
|
||||||
## 0.7.0 - 2026-09-12
|
## 0.7.0 - 2026-09-12
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ export type GlanceboardProvider = {
|
|||||||
size: { width: number; height: number };
|
size: { width: number; height: number };
|
||||||
/** Whether sleep-time gestures should show the board at all (user setting). */
|
/** Whether sleep-time gestures should show the board at all (user setting). */
|
||||||
isEnabled: () => boolean;
|
isEnabled: () => boolean;
|
||||||
|
/** Whether a single tap shows the board (for tapTimeoutMs). */
|
||||||
|
showOnTap: () => boolean;
|
||||||
/** How long a tap or head-tilt keeps the board up. */
|
/** How long a tap or head-tilt keeps the board up. */
|
||||||
tapTimeoutMs: () => number;
|
tapTimeoutMs: () => number;
|
||||||
/** Whether a long-press holds the board up until released. */
|
/** Whether a long-press holds the board up until released. */
|
||||||
|
|||||||
@@ -41,21 +41,35 @@ export const glanceboardEnabledSetting = new ConfigSettingBoolean({
|
|||||||
"While the display is asleep, a tap, a long-press or a head-tilt shows the Glanceboard instead of the regular UI. Double-tap still wakes the regular UI.",
|
"While the display is asleep, a tap, a long-press or a head-tilt shows the Glanceboard instead of the regular UI. Double-tap still wakes the regular UI.",
|
||||||
});
|
});
|
||||||
|
|
||||||
export type GlanceTapDuration = "3s" | "5s" | "7s" | "10s";
|
export type GlanceTapDuration = "off" | "3s" | "5s" | "7s" | "10s";
|
||||||
|
|
||||||
/** How long a tap (or head-tilt) keeps the board up; each further tap restarts it. */
|
const DEFAULT_TAP_DURATION: GlanceTapDuration = "5s";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How long a tap (or head-tilt) keeps the board up; each further tap restarts
|
||||||
|
* it. "off" means a single tap does not show the board at all; a head-tilt
|
||||||
|
* then uses the default duration.
|
||||||
|
*/
|
||||||
export const glanceTapDurationSetting = new ConfigSettingEnum<GlanceTapDuration>({
|
export const glanceTapDurationSetting = new ConfigSettingEnum<GlanceTapDuration>({
|
||||||
id: "glanceboard-tap-duration",
|
id: "glanceboard-tap-duration",
|
||||||
label: "Show on tap",
|
label: "Show on tap",
|
||||||
storageKey: "glanceboard.tapDuration",
|
storageKey: "glanceboard.tapDuration",
|
||||||
defaultValue: "5s",
|
defaultValue: DEFAULT_TAP_DURATION,
|
||||||
values: ["3s", "5s", "7s", "10s"],
|
values: ["off", "3s", "5s", "7s", "10s"],
|
||||||
formatValue: (value) => value.replace("s", " s"),
|
formatValue: (value) => (value === "off" ? "Disabled" : value.replace("s", " s")),
|
||||||
description: "How long a single tap (or a head-tilt) keeps the Glanceboard on screen.",
|
description:
|
||||||
|
"How long a single tap (or a head-tilt) keeps the Glanceboard on screen. Disabled: a single tap does not show the Glanceboard.",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/** Whether a single tap while asleep shows the board. */
|
||||||
|
export function glanceShowOnTap(): boolean {
|
||||||
|
return glanceTapDurationSetting.get() !== "off";
|
||||||
|
}
|
||||||
|
|
||||||
export function glanceTapTimeoutMs(): number {
|
export function glanceTapTimeoutMs(): number {
|
||||||
return Number.parseInt(glanceTapDurationSetting.get(), 10) * 1000;
|
const duration = glanceTapDurationSetting.get();
|
||||||
|
const seconds = duration === "off" ? DEFAULT_TAP_DURATION : duration;
|
||||||
|
return Number.parseInt(seconds, 10) * 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A long-press holds the board up until the press is released. */
|
/** A long-press holds the board up until the press is released. */
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
glanceboardEnabledSetting,
|
glanceboardEnabledSetting,
|
||||||
glanceShowOnHeadTiltSetting,
|
glanceShowOnHeadTiltSetting,
|
||||||
glanceShowOnLongPressSetting,
|
glanceShowOnLongPressSetting,
|
||||||
|
glanceShowOnTap,
|
||||||
glanceTapTimeoutMs,
|
glanceTapTimeoutMs,
|
||||||
} from "./glanceboard-settings";
|
} from "./glanceboard-settings";
|
||||||
import { QUADRANT_LAYOUT } from "./layout";
|
import { QUADRANT_LAYOUT } from "./layout";
|
||||||
@@ -17,6 +18,7 @@ const glanceboardApp: AppDefinition = {
|
|||||||
glanceboard: {
|
glanceboard: {
|
||||||
size: { width: QUADRANT_LAYOUT.width, height: QUADRANT_LAYOUT.height },
|
size: { width: QUADRANT_LAYOUT.width, height: QUADRANT_LAYOUT.height },
|
||||||
isEnabled: () => glanceboardEnabledSetting.get(),
|
isEnabled: () => glanceboardEnabledSetting.get(),
|
||||||
|
showOnTap: glanceShowOnTap,
|
||||||
tapTimeoutMs: glanceTapTimeoutMs,
|
tapTimeoutMs: glanceTapTimeoutMs,
|
||||||
showOnLongPress: () => glanceShowOnLongPressSetting.get(),
|
showOnLongPress: () => glanceShowOnLongPressSetting.get(),
|
||||||
showOnHeadTilt: () => glanceShowOnHeadTiltSetting.get(),
|
showOnHeadTilt: () => glanceShowOnHeadTiltSetting.get(),
|
||||||
|
|||||||
@@ -68,13 +68,15 @@ export class GlanceHost {
|
|||||||
/**
|
/**
|
||||||
* The glance event a sleep-time gesture means under the board's settings,
|
* The glance event a sleep-time gesture means under the board's settings,
|
||||||
* or null when the shell should see the input as usual: nothing while the
|
* or null when the shell should see the input as usual: nothing while the
|
||||||
* board is disabled, no hold when "Show on long press" is off, no press
|
* board is disabled, no press from a tap when "Show on tap" is disabled,
|
||||||
* from a head-tilt when "Show on head tilt" is off (it then wakes the
|
* no hold when "Show on long press" is off, no press from a head-tilt when
|
||||||
* regular UI). A release always passes so a hold in progress can end.
|
* "Show on head tilt" is off (it then wakes the regular UI). A release
|
||||||
|
* always passes so a hold in progress can end.
|
||||||
*/
|
*/
|
||||||
eventForGesture(gesture: "head-tilt" | string): GlanceEvent | null {
|
eventForGesture(gesture: "head-tilt" | string): GlanceEvent | null {
|
||||||
const provider = this.options.getProvider();
|
const provider = this.options.getProvider();
|
||||||
if (!provider?.isEnabled()) return null;
|
if (!provider?.isEnabled()) return null;
|
||||||
|
if (gesture === "click" && !provider.showOnTap()) return null;
|
||||||
if (gesture === "long-press" && !provider.showOnLongPress()) return null;
|
if (gesture === "long-press" && !provider.showOnLongPress()) return null;
|
||||||
if (gesture === "head-tilt" && !provider.showOnHeadTilt()) return null;
|
if (gesture === "head-tilt" && !provider.showOnHeadTilt()) return null;
|
||||||
return glanceEventForGesture(gesture, this.isVisible());
|
return glanceEventForGesture(gesture, this.isVisible());
|
||||||
|
|||||||
Reference in new issue
Block a user