forked from Blendman974/faceclaw
Glanceboard: address review of head-tilt angle and glance down
- A verification read that still disagrees no longer requeues the writes at once (which looped while the firmware refused the value); the next regular poll retries. - "Glasses default" now writes back the glasses' own switch and angle, saved before Faceclaw first changed them (persisted across app restarts), and drops writes still queued. Disabling the Glanceboard does the same. - "Set to current head angle" takes two readings, head level then tilted up, and uses the angle between them, so it no longer depends on the sensor's axes or folds past 45°. A head that did not move is reported, not stored as 5°. The math is in head-tilt-math.ts, with tests. - A head-tilt that woke a suspended session, or a trigger under 25° (where a level gaze stays above the head-down threshold), hides after the tap duration instead of the 60 s cap. The setting's description explains it. - The angle rows are hidden on iOS, which cannot change the setting. - The capture row repaints while measuring, ignores repeat selects, and its status clears when the menu reopens or the angle changes; the angle is sent once, by the controller's settings listener. - Comments describing a head-tilt as a timed press are updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cf74f34767
commit
b1ca8b8ca1
15 files changed
+476
-128
No files matched your search
@@ -20,8 +20,9 @@ import { shouldShowNotificationOnGlasses } from "../native/notification-sources"
|
||||
import { watchNotificationListenerBinding } from "../native/notification-access";
|
||||
import { openEvenAppSettings, readEvenAppNotificationState } from "../native/even-app-conflict";
|
||||
import { defaultRingName, setGlassesRingLink } from "../native/ring-status";
|
||||
import { applyGlanceAngle } from "./head-angle";
|
||||
import { glanceAngleDegrees } from "../apps/glanceboard/glanceboard-settings";
|
||||
import { applyGlanceAngle, glassesHeadUpTrigger, syncGlanceAngleOriginal } from "./head-angle";
|
||||
import { glanceAngleTriggerDegrees, glanceTapTimeoutMs } from "../apps/glanceboard/glanceboard-settings";
|
||||
import { glanceTiltMaxMs } from "./glance-state";
|
||||
import { getBooleanSetting, setBooleanSetting } from "../native/settings-store";
|
||||
import { grayImageToPreviewSource } from "../native/gray-image-preview";
|
||||
import { firmwareIncompatibilityMessage, hasCompatibleFirmware } from "./firmware-compat";
|
||||
@@ -335,7 +336,7 @@ class DashboardController {
|
||||
private evenHubResumePromise: Promise<boolean> | null = null;
|
||||
/** Faceclaw's firmware at the required revision reported in; its extensions can be used. */
|
||||
private customFirmwareConfirmed = false;
|
||||
private lastGlanceAngleDegrees = glanceAngleDegrees();
|
||||
private lastGlanceAngleDegrees = glanceAngleTriggerDegrees();
|
||||
private faceclawWakeLeaseState: boolean | null = null;
|
||||
/** Ring connection mode the current session was started with (it applies per connection). */
|
||||
private ringModeAtConnect: RingConnectionMode = "glasses";
|
||||
@@ -1758,6 +1759,7 @@ class DashboardController {
|
||||
this.requestShellRender();
|
||||
this.updateCompositePreview();
|
||||
this.updateConnectedForegroundNotification();
|
||||
syncGlanceAngleOriginal();
|
||||
}, SHELL_REFRESH_INTERVAL_MS);
|
||||
this.previewTimer = setInterval(() => this.updateCompositePreview(), PREVIEW_INTERVAL_MS);
|
||||
this.screenTimeoutTimer = setInterval(() => {
|
||||
@@ -2520,9 +2522,9 @@ class DashboardController {
|
||||
}
|
||||
}
|
||||
|
||||
/** Re-send the head-tilt angle when the setting changed (from either settings UI). */
|
||||
/** Re-send the head-tilt angle when it changed (the setting, from either settings UI, or the Glanceboard toggle). */
|
||||
private applyGlanceAngleIfChanged(): void {
|
||||
const degrees = glanceAngleDegrees();
|
||||
const degrees = glanceAngleTriggerDegrees();
|
||||
if (degrees === this.lastGlanceAngleDegrees) return;
|
||||
this.lastGlanceAngleDegrees = degrees;
|
||||
applyGlanceAngle();
|
||||
@@ -2531,12 +2533,20 @@ class DashboardController {
|
||||
/**
|
||||
* The Glanceboard event a sleep-time input means, or null when the shell
|
||||
* should see the input as usual. A display-wake carries the head-tilt
|
||||
* gesture (HEAD_UP_EVENT) as a press; the double-tap display-wake stays the
|
||||
* regular UI's wake.
|
||||
* gesture (HEAD_UP_EVENT) as a tilt, which lasts until the head-down; the
|
||||
* double-tap display-wake stays the regular UI's wake.
|
||||
*/
|
||||
private glanceEventFor(inputEvent: InputEvent, event: RawInputEvent): GlanceEvent | null {
|
||||
if (inputEvent.type === "display-wake") {
|
||||
return event.eventType === OsEventTypeList.HEAD_UP_EVENT ? this.glance.eventForGesture("head-tilt") : null;
|
||||
if (event.eventType !== OsEventTypeList.HEAD_UP_EVENT) return null;
|
||||
const glanceEvent = this.glance.eventForGesture("head-tilt");
|
||||
if (glanceEvent?.type !== "tilt") return glanceEvent;
|
||||
const maxMs = glanceTiltMaxMs({
|
||||
resumedSession: this.evenHubSessionSuspended || this.evenHubResumePromise !== null,
|
||||
triggerDegrees: glassesHeadUpTrigger() ?? (glanceAngleTriggerDegrees() || null),
|
||||
tapTimeoutMs: glanceTapTimeoutMs(),
|
||||
});
|
||||
return { type: "tilt", maxMs };
|
||||
}
|
||||
return this.glance.eventForGesture(inputEvent.type);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user