mirror of
https://git.undefined-dev.fr/Blendman974/faceclaw.git
synced 2026-11-19 21:03:09 +00:00
Swap app and system context menu gestures
This commit is contained in:
1 parent
987f442897
commit
83c3732ba7
23 files changed
+213
-153
No files matched your search
@@ -1,8 +1,10 @@
|
||||
# Changelog
|
||||
|
||||
## 0.6.5 - Future
|
||||
* Changed context menu gestures: — for system, ●— for app context menu.
|
||||
* System and app context menus show gesture help for switching to the other context menu
|
||||
* Move some items from app context menus to the system context menu
|
||||
* Long-press now opens the system context menu and tap-then-hold the app context menu (games keep long-press as a move while playing)
|
||||
|
||||
## 0.6.4 - 2026-09-02
|
||||
* Context menus are centered and include window title
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Controls (in play): scroll moves the piece, click rotates, long-press hard
|
||||
* drops, double-click pauses. Watch swipes are spatial: left/right move,
|
||||
* up rotates, down hard-drops. Paused: click resumes, double-click yields
|
||||
* focus, long-press opens the window menu.
|
||||
* focus, tap-then-hold opens the window menu.
|
||||
*/
|
||||
import "@nativescript/core/globals";
|
||||
import { GrayImage } from "../../graphics/image";
|
||||
@@ -143,7 +143,7 @@ type BlocksWindow = {
|
||||
foreground: boolean;
|
||||
/** Whether this window is the shell's input target (pushed with each message). */
|
||||
focused: boolean;
|
||||
/** Long-press window menu; created on first open. */
|
||||
/** Tap-then-hold window menu; created on first open. */
|
||||
menu: WindowMenu | null;
|
||||
phase: GamePhase;
|
||||
/** Locked cells; 0 = empty, otherwise the piece's shade byte. */
|
||||
@@ -288,7 +288,7 @@ function playSfx(window: BlocksWindow, steps: Step[]): void {
|
||||
}
|
||||
}
|
||||
|
||||
/** The window's long-press menu (sound toggle); playing binds long-press to hard drop instead. */
|
||||
/** The window's context menu (sound toggle), offered while paused or over; playing keeps long-press for hard drop. */
|
||||
function windowMenuItems(window: BlocksWindow): MenuItem[] {
|
||||
return [
|
||||
{
|
||||
@@ -308,8 +308,8 @@ function windowMenu(window: BlocksWindow): WindowMenu {
|
||||
windowId: window.windowId,
|
||||
post,
|
||||
title: () => window.title,
|
||||
items: () => windowMenuItems(window),
|
||||
longPressOpensMenu: () => window.phase !== "playing",
|
||||
items: () => (window.phase === "playing" ? [] : windowMenuItems(window)),
|
||||
claimsLongPress: () => window.phase === "playing",
|
||||
size: { width: window.viewportWidth, height: window.viewportHeight },
|
||||
paintBase: () => paintContent(window),
|
||||
isFocused: () => window.focused,
|
||||
@@ -360,6 +360,10 @@ function handlePlayingInput(window: BlocksWindow, event: InputEvent, frameId: nu
|
||||
case "long-press":
|
||||
hardDrop(window);
|
||||
break;
|
||||
case "short-then-long-press":
|
||||
// No context menu mid-game, so this opens the system menu instead.
|
||||
windowMenu(window).open();
|
||||
break;
|
||||
case "double-click":
|
||||
window.phase = "paused";
|
||||
updateTickTimer(window);
|
||||
@@ -385,7 +389,7 @@ function handleIdleInput(window: BlocksWindow, event: InputEvent, frameId: numbe
|
||||
frameTimings.finishFrame(frameId, "discarded: blocks yielded focus");
|
||||
post({ type: "yield-focus", windowId: window.windowId });
|
||||
return;
|
||||
case "long-press":
|
||||
case "short-then-long-press":
|
||||
windowMenu(window).open();
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Calculator window wiring: the in-process window, its long-press menu (mode
|
||||
* Calculator window wiring: the in-process window, its context menu (mode
|
||||
* follow-ups, clear, settings), the assistant tools, and the voice/text
|
||||
* plumbing into the layer.
|
||||
*
|
||||
|
||||
@@ -35,10 +35,11 @@ class EvenHubAppLayer implements Layer {
|
||||
}
|
||||
|
||||
handleInput(event: InputEvent): void {
|
||||
// Everything goes to the app; long-press never reaches here (the window
|
||||
// menu intercepts it), which is the guaranteed way out since EvenHub
|
||||
// apps own double-click. The press is still reported to the app as
|
||||
// LONG_PRESS_EVENT — see the handleInput wrapper below.
|
||||
// Everything goes to the app; the menu gestures never reach here (the
|
||||
// shell keeps long-press for its system menu and the window's context
|
||||
// menu intercepts tap-then-hold), which is the guaranteed way out since
|
||||
// EvenHub apps own double-click. Tap-then-hold is still reported to the
|
||||
// app as LONG_PRESS_EVENT — see the handleInput wrapper below.
|
||||
this.session.handleGesture(event);
|
||||
}
|
||||
}
|
||||
@@ -62,7 +63,7 @@ export function createEvenHubWindow(
|
||||
fallbackIcon,
|
||||
),
|
||||
heightMode: "medium",
|
||||
// The window's long-press menu doubles as the OS contextual menu EvenHub
|
||||
// The window's context menu doubles as the OS contextual menu EvenHub
|
||||
// apps register with `menuObject` (SDK 0.0.14): the app's own entries come
|
||||
// first, then the host entries. Evaluated at open time, so a rebuild that
|
||||
// changes or clears the menu is reflected on the next press.
|
||||
@@ -101,13 +102,15 @@ export function createEvenHubWindow(
|
||||
windowId,
|
||||
});
|
||||
|
||||
// LONG_PRESS_EVENT / LONG_PRESS_RELEASE_EVENT (SDK 0.0.14). Wrapped at the
|
||||
// window rather than handled in the base layer because the press opens the
|
||||
// window menu and so never reaches a layer, and because the release lands on
|
||||
// that menu once it is up.
|
||||
// LONG_PRESS_EVENT / LONG_PRESS_RELEASE_EVENT (SDK 0.0.14): the app hears
|
||||
// the context-menu gesture (tap-then-hold; a plain long-press is the
|
||||
// shell's and never arrives) as its long-press. Wrapped at the window
|
||||
// rather than handled in the base layer because the press opens the window
|
||||
// menu and so never reaches a layer, and because the release lands on that
|
||||
// menu once it is up.
|
||||
const baseHandleInput = created.window.handleInput;
|
||||
created.window.handleInput = async (event, frameId) => {
|
||||
if (event.type === "long-press" || event.type === "long-press-release") {
|
||||
if (event.type === "short-then-long-press" || event.type === "long-press-release") {
|
||||
session.handleGesture(event);
|
||||
}
|
||||
await baseHandleInput(event, frameId);
|
||||
|
||||
@@ -447,13 +447,16 @@ export class EvenHubSession implements EvenHubMicClient, EvenHubImuClient, EvenH
|
||||
this.emitSysEvent(DOUBLE_CLICK_EVENT, gestureSource(event.source));
|
||||
break;
|
||||
case "long-press":
|
||||
case "short-then-long-press":
|
||||
case "long-press-release": {
|
||||
// SDK 0.0.14 exposes press and release as ordinary events. The window
|
||||
// still opens its menu on the same gesture (that menu is where the
|
||||
// app's contextual-menu items live, and it is the way out of an app
|
||||
// that owns double-click), so an app hears the press as well as
|
||||
// seeing the menu — it cannot be given exclusive use of the gesture.
|
||||
const eventType = event.type === "long-press" ? LONG_PRESS_EVENT : LONG_PRESS_RELEASE_EVENT;
|
||||
// SDK 0.0.14 exposes press and release as ordinary events. The app's
|
||||
// press is the context-menu gesture (tap-then-hold; the shell keeps
|
||||
// the plain long-press for its system menu): the window still opens
|
||||
// its menu on it (that menu is where the app's contextual-menu items
|
||||
// live, and it is the way out of an app that owns double-click), so
|
||||
// an app hears the press as well as seeing the menu — it cannot be
|
||||
// given exclusive use of the gesture.
|
||||
const eventType = event.type === "long-press-release" ? LONG_PRESS_RELEASE_EVENT : LONG_PRESS_EVENT;
|
||||
if (capture?.kind === "list") {
|
||||
this.emitListEvent(capture, eventType);
|
||||
} else {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* on a destination moves there; cascade-to-cascade moves take the longest
|
||||
* legal run that fits (supermoves via empty cells/columns). Double-click
|
||||
* sends the card at the cursor to its foundation, or cancels a pending
|
||||
* selection. Long-press opens the window menu (undo, new game, restart).
|
||||
* selection. Tap-then-hold opens the window menu (undo, new game, restart).
|
||||
* Watch swipes move the cursor spatially: left/right within the row, up/down
|
||||
* between the top row (cells + foundations) and the cascades.
|
||||
* Safe cards auto-play to the foundations after every move.
|
||||
@@ -106,7 +106,7 @@ type FreecellWindow = {
|
||||
foreground: boolean;
|
||||
/** Whether this window is the shell's input target (pushed with each message). */
|
||||
focused: boolean;
|
||||
/** Long-press window menu; created on first open. */
|
||||
/** Tap-then-hold window menu; created on first open. */
|
||||
menu: WindowMenu | null;
|
||||
phase: "playing" | "won";
|
||||
cascades: number[][];
|
||||
@@ -214,7 +214,7 @@ function playSfx(window: FreecellWindow, steps: Step[]): void {
|
||||
}
|
||||
}
|
||||
|
||||
/** The window's long-press menu (game actions). */
|
||||
/** The window's context menu (game actions). */
|
||||
function windowMenuItems(window: FreecellWindow): MenuItem[] {
|
||||
const items: MenuItem[] = [];
|
||||
if (window.undoStack.length > 0 && window.phase === "playing") {
|
||||
@@ -332,7 +332,7 @@ function handlePlayingInput(window: FreecellWindow, event: InputEvent, frameId:
|
||||
sendToFoundation(window, window.cursor);
|
||||
}
|
||||
break;
|
||||
case "long-press":
|
||||
case "short-then-long-press":
|
||||
windowMenu(window).open();
|
||||
break;
|
||||
default:
|
||||
@@ -352,7 +352,7 @@ function handleWonInput(window: FreecellWindow, event: InputEvent, frameId: numb
|
||||
frameTimings.finishFrame(frameId, "discarded: freecell yielded focus");
|
||||
post({ type: "yield-focus", windowId: window.windowId });
|
||||
return;
|
||||
case "long-press":
|
||||
case "short-then-long-press":
|
||||
windowMenu(window).open();
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -169,7 +169,7 @@ class LauncherGridLayer implements Layer {
|
||||
}
|
||||
|
||||
/**
|
||||
* App-specific entries for the window's long-press menu. Only item mode
|
||||
* App-specific entries for the window's context menu. Only item mode
|
||||
* pins the selection to a single cell, and only apps can move to folders,
|
||||
* so anywhere else the menu falls back to just the defaults.
|
||||
*/
|
||||
|
||||
@@ -101,7 +101,7 @@ type MinesweeperWindow = {
|
||||
foreground: boolean;
|
||||
/** Whether this window is the shell's input target (pushed with each message). */
|
||||
focused: boolean;
|
||||
/** Long-press window menu; created on first open. */
|
||||
/** Tap-then-hold window menu; created on first open. */
|
||||
menu: WindowMenu | null;
|
||||
phase: GamePhase;
|
||||
difficultyIndex: number;
|
||||
@@ -252,7 +252,7 @@ function playSfx(window: MinesweeperWindow, steps: Step[]): void {
|
||||
}
|
||||
}
|
||||
|
||||
/** The window's long-press menu (game actions); playing binds long-press to flagging instead. */
|
||||
/** The window's context menu (game actions), offered while paused or over; playing keeps long-press for flagging. */
|
||||
function windowMenuItems(window: MinesweeperWindow): MenuItem[] {
|
||||
const nextDifficulty = DIFFICULTIES[(window.difficultyIndex + 1) % DIFFICULTIES.length]!;
|
||||
return [
|
||||
@@ -290,8 +290,8 @@ function windowMenu(window: MinesweeperWindow): WindowMenu {
|
||||
windowId: window.windowId,
|
||||
post,
|
||||
title: () => window.title,
|
||||
items: () => windowMenuItems(window),
|
||||
longPressOpensMenu: () => window.phase !== "playing",
|
||||
items: () => (window.phase === "playing" ? [] : windowMenuItems(window)),
|
||||
claimsLongPress: () => window.phase === "playing",
|
||||
size: { width: window.viewportWidth, height: window.viewportHeight },
|
||||
paintBase: () => paintContent(window),
|
||||
isFocused: () => window.focused,
|
||||
@@ -366,6 +366,10 @@ function handlePlayingInput(window: MinesweeperWindow, event: InputEvent, frameI
|
||||
}
|
||||
toggleFlag(window);
|
||||
break;
|
||||
case "short-then-long-press":
|
||||
// No context menu mid-game, so this opens the system menu instead.
|
||||
windowMenu(window).open();
|
||||
break;
|
||||
case "double-click":
|
||||
if (rowMode || watch) {
|
||||
window.phase = "paused";
|
||||
@@ -398,7 +402,7 @@ function handleIdleInput(window: MinesweeperWindow, event: InputEvent, frameId:
|
||||
frameTimings.finishFrame(frameId, "discarded: minesweeper yielded focus");
|
||||
post({ type: "yield-focus", windowId: window.windowId });
|
||||
return;
|
||||
case "long-press":
|
||||
case "short-then-long-press":
|
||||
windowMenu(window).open();
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -612,7 +612,7 @@ function describeRouteStatus(): string {
|
||||
// ---------------------------------------------------------------------------
|
||||
// Input
|
||||
|
||||
/** The window's long-press menu: only Stop navigation, and only while a route is up. */
|
||||
/** The window's context menu: only Stop navigation, and only while a route is up. */
|
||||
function windowMenuItems(win: NavWindow): MenuItem[] {
|
||||
if (phase !== "navigating" && phase !== "arrived") return [];
|
||||
return [
|
||||
@@ -650,7 +650,7 @@ function handleInput(win: NavWindow, event: InputEvent, frameId: number): void {
|
||||
.then(() => renderAndSubmit(win, frameId));
|
||||
return;
|
||||
}
|
||||
if (event.type === "long-press") {
|
||||
if (event.type === "short-then-long-press") {
|
||||
windowMenu(win).open();
|
||||
renderAndSubmit(win, frameId);
|
||||
return;
|
||||
@@ -708,7 +708,7 @@ function paintIdle(image: GrayImage): void {
|
||||
image.drawText(mediumFont, 24, 16, "Navigate", 245);
|
||||
const busy = phase !== "idle";
|
||||
const hint = isMapboxConfigured()
|
||||
? "Ask the voice assistant to navigate somewhere, or pick Voice input from the system menu (tap, then hold) to say a destination."
|
||||
? "Ask the voice assistant to navigate somewhere, or pick Voice input from the system menu (long-press) to say a destination."
|
||||
: "Set a Mapbox token in Settings > API Keys to enable navigation.";
|
||||
image.drawTextWrapped({ font: smallFont, x: 24, y: 64, width: image.width - 48, text: hint, value: 170 });
|
||||
if (statusMessage) {
|
||||
|
||||
@@ -249,7 +249,7 @@ type PinballWindow = {
|
||||
foreground: boolean;
|
||||
/** Whether this window is the shell's input target (pushed with each message). */
|
||||
focused: boolean;
|
||||
/** Long-press window menu; created on first open. */
|
||||
/** Tap-then-hold window menu; created on first open. */
|
||||
menu: WindowMenu | null;
|
||||
phase: GamePhase;
|
||||
/** "ready" = parked on the plunger awaiting launch; "live" = in play. */
|
||||
@@ -446,7 +446,7 @@ function playSfx(window: PinballWindow, steps: Step[], minor = false): void {
|
||||
}
|
||||
}
|
||||
|
||||
/** The window's long-press menu (game actions); playing binds long-press to the nudge instead. */
|
||||
/** The window's context menu (game actions), offered while paused or over; playing keeps long-press for the nudge. */
|
||||
function windowMenuItems(window: PinballWindow): MenuItem[] {
|
||||
return [
|
||||
{
|
||||
@@ -474,8 +474,8 @@ function windowMenu(window: PinballWindow): WindowMenu {
|
||||
windowId: window.windowId,
|
||||
post,
|
||||
title: () => window.title,
|
||||
items: () => windowMenuItems(window),
|
||||
longPressOpensMenu: () => window.phase !== "playing",
|
||||
items: () => (window.phase === "playing" ? [] : windowMenuItems(window)),
|
||||
claimsLongPress: () => window.phase === "playing",
|
||||
size: { width: window.viewportWidth, height: window.viewportHeight },
|
||||
paintBase: () => paintContent(window),
|
||||
isFocused: () => window.focused,
|
||||
@@ -554,6 +554,10 @@ function handlePlayingInput(window: PinballWindow, event: InputEvent, frameId: n
|
||||
}
|
||||
nudge(window);
|
||||
break;
|
||||
case "short-then-long-press":
|
||||
// No context menu mid-game, so this opens the system menu instead.
|
||||
windowMenu(window).open();
|
||||
break;
|
||||
case "double-click":
|
||||
window.phase = "paused";
|
||||
syncTickTimer(window);
|
||||
@@ -580,7 +584,7 @@ function handleIdleInput(window: PinballWindow, event: InputEvent, frameId: numb
|
||||
frameTimings.finishFrame(frameId, "discarded: pinball yielded focus");
|
||||
post({ type: "yield-focus", windowId: window.windowId });
|
||||
return;
|
||||
case "long-press":
|
||||
case "short-then-long-press":
|
||||
windowMenu(window).open();
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -104,7 +104,7 @@ async function roamPost(endpoint: "q" | "pull" | "write", body: object): Promise
|
||||
const graph = roamGraphNameSetting.get();
|
||||
const token = roamApiTokenSetting.get();
|
||||
if (!graph || !token) {
|
||||
throw new Error("Set the Roam graph name and API token from the Roam app's long-press menu.");
|
||||
throw new Error("Set the Roam graph name and API token from the Roam app's context menu (tap, then hold).");
|
||||
}
|
||||
const path = `/api/graph/${encodeURIComponent(graph)}/${endpoint}`;
|
||||
const payload = JSON.stringify(body);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* todo or follows a [[page]] link, double-click walks back through visited
|
||||
* pages then yields focus. Edits (check/uncheck, add todo, edit block) go
|
||||
* through the Roam backend API and are also exposed as assistant tools.
|
||||
* The graph name and API token are configured here too, from the long-press
|
||||
* The graph name and API token are configured here too, from the context
|
||||
* menu, via the phone app's text editor.
|
||||
*/
|
||||
import "@nativescript/core/globals";
|
||||
@@ -423,7 +423,7 @@ function handleInput(win: RoamWindow, event: InputEvent, frameId: number): void
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (event.type === "long-press") {
|
||||
if (event.type === "short-then-long-press") {
|
||||
windowMenu(win).open();
|
||||
renderAndSubmit(win, frameId);
|
||||
return;
|
||||
@@ -525,7 +525,7 @@ async function addTodoFromText(text: string): Promise<void> {
|
||||
|
||||
async function handleRoamTool(name: string, args: any): Promise<ToolResult> {
|
||||
if (!isRoamConfigured()) {
|
||||
return { ok: false, error: "Roam is not configured; set the graph name and API token from the Roam app's long-press menu." };
|
||||
return { ok: false, error: "Roam is not configured; set the graph name and API token from the Roam app's context menu (tap, then hold)." };
|
||||
}
|
||||
switch (name) {
|
||||
case "read_page": {
|
||||
@@ -634,7 +634,7 @@ function paintContent(win: RoamWindow): GrayImage {
|
||||
image.drawLine(DOC_MARGIN, HEADER_HEIGHT - 4, win.viewportWidth - DOC_MARGIN, HEADER_HEIGHT - 4, 40);
|
||||
|
||||
if (!isRoamConfigured()) {
|
||||
drawBodyMessage(image, win, "Set the Roam graph name and API token: long-press for the menu, then pick Set graph name and Set API token.");
|
||||
drawBodyMessage(image, win, "Set the Roam graph name and API token: tap, then hold, for the menu; pick Set graph name and Set API token.");
|
||||
} else if (errorMessage) {
|
||||
drawBodyMessage(image, win, `${errorMessage}\n\n${GESTURE_CLICK} retry`);
|
||||
} else if (currentPage && currentPage.children.length === 0 && !loading) {
|
||||
|
||||
@@ -901,7 +901,7 @@ function reconnectView(window: ViewWindow): void {
|
||||
scheduleRender(window);
|
||||
}
|
||||
|
||||
/** The window's long-press menu, created lazily so window literals stay simple. */
|
||||
/** The window's context menu, created lazily so window literals stay simple. */
|
||||
function windowMenu(window: TerminalWindow): WindowMenu {
|
||||
if (!window.menu) {
|
||||
window.menu = new WindowMenu({
|
||||
@@ -1000,7 +1000,7 @@ function handleInput(window: TerminalWindow, event: InputEvent, frameId: number)
|
||||
.then(() => renderAndSubmit(window, frameId));
|
||||
return;
|
||||
}
|
||||
if (event.type === "long-press") {
|
||||
if (event.type === "short-then-long-press") {
|
||||
windowMenu(window).open();
|
||||
renderAndSubmit(window, frameId);
|
||||
return;
|
||||
|
||||
@@ -48,7 +48,7 @@ type TimerWindow = {
|
||||
foreground: boolean;
|
||||
/** Whether this window is the shell's input target (pushed with each message). */
|
||||
focused: boolean;
|
||||
/** Long-press window menu; created on first open. */
|
||||
/** Tap-then-hold window menu; created on first open. */
|
||||
menu: WindowMenu | null;
|
||||
view: TimerView;
|
||||
stopwatchAction: number;
|
||||
@@ -295,8 +295,8 @@ function refreshWindowsAfterToolChange(): void {
|
||||
}
|
||||
|
||||
/**
|
||||
* The window's long-press menu, created lazily. The timer has no entries of
|
||||
* its own, so a long-press opens the shell's system menu in its place.
|
||||
* The window's context menu, created lazily. The timer has no entries of
|
||||
* its own, so tap-then-hold opens the shell's system menu in its place.
|
||||
*/
|
||||
function windowMenu(window: TimerWindow): WindowMenu {
|
||||
if (!window.menu) {
|
||||
@@ -322,7 +322,7 @@ function handleInput(window: TimerWindow, event: InputEvent, frameId: number): v
|
||||
.then(() => renderAndSubmit(window, frameId));
|
||||
return;
|
||||
}
|
||||
if (event.type === "long-press") {
|
||||
if (event.type === "short-then-long-press") {
|
||||
windowMenu(window).open();
|
||||
renderAndSubmit(window, frameId);
|
||||
return;
|
||||
|
||||
@@ -57,7 +57,7 @@ async function callAppTool(
|
||||
args: unknown,
|
||||
): Promise<ToolResult> {
|
||||
if (roamGraphNameSetting.get().length === 0 || roamApiTokenSetting.get().length === 0) {
|
||||
return err("Roam is not configured; the user must set the graph name and API token from the Roam app's long-press menu.");
|
||||
return err("Roam is not configured; the user must set the graph name and API token from the Roam app's context menu (tap, then hold).");
|
||||
}
|
||||
return callAppToolWithLaunch(registry, launchApp, "roam", unprefixedName, args);
|
||||
}
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ export type InputEventPayload =
|
||||
| { type: "scroll-down"; source?: InputSource }
|
||||
| { type: "long-press"; source: InputSource }
|
||||
| { type: "long-press-release"; source: InputSource }
|
||||
/** G2 2.2.9 tap-then-hold gesture, reserved for the shell system menu. */
|
||||
/** G2 2.2.9 tap-then-hold gesture: the app context-menu gesture (long-press is the system menu's). */
|
||||
| { type: "short-then-long-press"; source: InputSource }
|
||||
/**
|
||||
* Not a gesture: a shell -> foreground-window notification that the shell
|
||||
@@ -114,8 +114,8 @@ export function directionalFallback(event: InputEvent): InputEvent {
|
||||
* click ● (U+00B7 middle dot)
|
||||
* double-click ●● (twice)
|
||||
* scroll ▲▼ (U+25B2 / U+25BC)
|
||||
* long-press - (hyphen-minus)
|
||||
* tap-then-hold ●- (click then long-press)
|
||||
* long-press — (em dash)
|
||||
* tap-then-hold ●— (click then long-press)
|
||||
*/
|
||||
export const GESTURE_CLICK = "\u25cf";
|
||||
export const GESTURE_DOUBLE_CLICK = GESTURE_CLICK+GESTURE_CLICK;
|
||||
|
||||
@@ -31,11 +31,11 @@ export type InProcessWindowOptions = {
|
||||
/** Window height: the standard 288px band ("min", default) or full screen ("max"). */
|
||||
heightMode?: WindowHeightMode;
|
||||
/**
|
||||
* The window's long-press context menu: app-specific entries only (the
|
||||
* The window's tap-then-hold context menu: app-specific entries only (the
|
||||
* shared Focus app switcher / Voice input / Close window entries live in
|
||||
* the shell's system menu). Called at open time, so the items can reflect
|
||||
* current app state. Omitted or empty means the window has no menu of its
|
||||
* own, and a long-press opens the system menu instead.
|
||||
* the shell's system menu, on long-press). Called at open time, so the
|
||||
* items can reflect current app state. Omitted or empty means the window
|
||||
* has no menu of its own, and tap-then-hold opens the system menu instead.
|
||||
*/
|
||||
menuItems?: () => MenuItem[];
|
||||
/** Shared actions; requestRender is rebound to this window's render. */
|
||||
@@ -132,7 +132,7 @@ export function createInProcessWindow(options: InProcessWindowOptions): InProces
|
||||
|
||||
const appMenuItems = () => options.menuItems?.() ?? [];
|
||||
|
||||
// The window's long-press menu: the app's own entries, or the shell's
|
||||
// The window's tap-then-hold menu: the app's own entries, or the shell's
|
||||
// system menu when it has none (so both gestures land on the same menu).
|
||||
const openWindowMenu = () => {
|
||||
if (stack.topMatches((layer) => layer instanceof WindowMenuLayer)) return;
|
||||
@@ -173,10 +173,12 @@ export function createInProcessWindow(options: InProcessWindowOptions): InProces
|
||||
}
|
||||
return;
|
||||
}
|
||||
// The default long-press response: the window menu (or the system
|
||||
// The default tap-then-hold response: the window menu (or the system
|
||||
// menu in its place). Handled here (not per-layer) so it works over
|
||||
// submenus and app content alike.
|
||||
if (event.type === "long-press") {
|
||||
// submenus and app content alike. A plain long-press never arrives:
|
||||
// the shell keeps it for the system menu (no in-process window claims
|
||||
// it).
|
||||
if (event.type === "short-then-long-press") {
|
||||
openWindowMenu();
|
||||
await render(frameId);
|
||||
return;
|
||||
|
||||
+66
-40
@@ -5,7 +5,7 @@ import { EvenAIStatus, EventSourceType, OsEventTypeList, WatchGestureType } from
|
||||
import type { RawInputEvent } from "../../native/faceclaw-communicator";
|
||||
import {
|
||||
directionalFallback,
|
||||
GESTURE_LONG_PRESS,
|
||||
GESTURE_SHORT_THEN_LONG_PRESS,
|
||||
gestureHints,
|
||||
InputEvent,
|
||||
type InputEventPayload,
|
||||
@@ -59,13 +59,14 @@ import {
|
||||
*
|
||||
* Input flow: every event enters via receiveInput. The shell consumes
|
||||
* everything while the sidebar or a shell overlay has focus and forwards the
|
||||
* rest to the focused window. Long-press goes to the foreground window (from
|
||||
* the sidebar it focuses the window first); by convention apps answer it with
|
||||
* rest to the focused window. Long-press opens the shell-owned system menu
|
||||
* (Focus app switcher, Voice input, Close window, Debug) without reaching the
|
||||
* app, so the shell keeps working when a window's handler hangs; a window
|
||||
* that claims long-press for a move of its own gets it forwarded instead, and
|
||||
* holding the press past the escape threshold still opens the system menu.
|
||||
* The 2.2.9 tap-then-hold gesture goes to the foreground window (from the
|
||||
* sidebar it focuses the window first); by convention apps answer it with
|
||||
* their own context menu, or ask for the system menu when they have none.
|
||||
* The system menu (Focus app switcher, Voice input, Close window, Debug) is
|
||||
* shell-owned: the 2.2.9 tap-then-hold gesture opens it directly, and holding
|
||||
* a long-press past the escape threshold opens it too, so the shell keeps
|
||||
* working when a window's handler hangs.
|
||||
*/
|
||||
|
||||
export type ShellWindow = {
|
||||
@@ -77,12 +78,18 @@ export type ShellWindow = {
|
||||
/** Whether the system menu offers Close window (the launcher is pinned). */
|
||||
closeable: boolean;
|
||||
/**
|
||||
* True when a long-press currently opens the window's own context menu
|
||||
* True when tap-then-hold currently opens the window's own context menu
|
||||
* (with at least one entry). While false, the system menu shows no
|
||||
* "long-press: app menu" hint and a long-press over the open system menu
|
||||
* leaves it open instead of switching menus.
|
||||
* app-menu hint and a tap-then-hold over the open system menu leaves it
|
||||
* open instead of switching menus.
|
||||
*/
|
||||
hasAppMenu?: () => boolean;
|
||||
/**
|
||||
* True while the window gives long-press a meaning of its own (a game
|
||||
* move). The shell then forwards long-presses to it instead of opening the
|
||||
* system menu; holding the press past the escape threshold still opens it.
|
||||
*/
|
||||
claimsLongPress?: () => boolean;
|
||||
/**
|
||||
* True when the window gives swipe-left / swipe-right (watch directional
|
||||
* input) a meaning; otherwise the shell forwards directionalFallback(event).
|
||||
@@ -171,9 +178,10 @@ export type FocusKind = "sidebar" | "window";
|
||||
const noopActions: LayerActions = noopLayerActions;
|
||||
|
||||
/**
|
||||
* Hold a long-press this much past the long-press event (which the firmware
|
||||
* itself only fires after a shorter hold) and the shell opens its own escape
|
||||
* menu — the recovery path when an app ignores or mishandles the gesture.
|
||||
* For a window that claims long-press: hold the press this much past the
|
||||
* long-press event (which the firmware itself only fires after a shorter
|
||||
* hold) and the shell opens the system menu anyway — the recovery path when
|
||||
* the app ignores or mishandles the gesture.
|
||||
*/
|
||||
const LONG_PRESS_ESCAPE_MENU_MS = 4000;
|
||||
|
||||
@@ -652,28 +660,46 @@ class Shell {
|
||||
return { shell: false, window: false };
|
||||
}
|
||||
|
||||
// The 2.2.9 tap-then-hold gesture is a direct, shell-owned escape hatch.
|
||||
// Unlike an ordinary long-press it never reaches the app or starts the
|
||||
// fallback timer: it opens the same system menu that an extended hold
|
||||
// would eventually open. Its later generic release is consumed while the
|
||||
// shell overlay is active and therefore cannot leak into the app.
|
||||
if (event.type === "short-then-long-press") {
|
||||
this.openEscapeMenu();
|
||||
return { shell: true, window: false };
|
||||
// Long-press is the shell's own gesture: it opens the system menu
|
||||
// directly, never reaching the app — over the app's own context menu
|
||||
// too (the window closes that on system-menu-opened), while an already
|
||||
// open system menu just stays. Its later generic release is consumed
|
||||
// while the shell overlay is active and therefore cannot leak into the
|
||||
// app. The exception is a window that claims long-press for a move of
|
||||
// its own: it gets the press forwarded, with the escape timer running
|
||||
// so that holding the press long enough still opens the system menu.
|
||||
if (event.type === "long-press") {
|
||||
if (this.activeVoiceLayer || !this.stack.isAtBase()) {
|
||||
return { shell: true, window: false };
|
||||
}
|
||||
const window = this.foregroundWindow();
|
||||
if (!window) {
|
||||
return { shell: true, window: false };
|
||||
}
|
||||
if (!window.claimsLongPress?.()) {
|
||||
this.openEscapeMenu();
|
||||
return { shell: true, window: false };
|
||||
}
|
||||
this.startEscapeMenuTimer();
|
||||
if (this.focus === "sidebar") {
|
||||
this.focus = "window";
|
||||
window.onFocus?.(this.lastInput);
|
||||
}
|
||||
// The window owns frameId from here (render or explicit finish).
|
||||
await window.handleInput(event, frameId);
|
||||
return { shell: true, window: true };
|
||||
}
|
||||
|
||||
// Long-press goes to the foreground window (from the sidebar it focuses
|
||||
// the window first); apps conventionally answer it with their context
|
||||
// menu, or ask for the system menu when they have none. The escape timer
|
||||
// runs regardless of what the app does with it: holding the press long
|
||||
// enough opens the shell's own menu.
|
||||
if (event.type === "long-press") {
|
||||
this.startEscapeMenuTimer();
|
||||
// The 2.2.9 tap-then-hold gesture is the app's context-menu gesture: it
|
||||
// goes to the foreground window (from the sidebar it focuses the window
|
||||
// first), which answers with its own menu or asks for the system menu
|
||||
// when it has none.
|
||||
if (event.type === "short-then-long-press") {
|
||||
const window = this.foregroundWindow();
|
||||
// A long-press while the system menu is open switches to the app's
|
||||
// context menu: close the system menu and deliver the press to the
|
||||
// window as usual. A window without a menu of its own would only ask
|
||||
// for the system menu back, so for it the open menu stays.
|
||||
// Over the open system menu it switches to the app's context menu:
|
||||
// close the system menu and deliver the gesture to the window as
|
||||
// usual. A window without a menu of its own would only ask for the
|
||||
// system menu back, so for it the open menu stays.
|
||||
if (
|
||||
!this.activeVoiceLayer &&
|
||||
window?.hasAppMenu?.() &&
|
||||
@@ -1184,7 +1210,7 @@ class Shell {
|
||||
}
|
||||
|
||||
/**
|
||||
* A window's answer to a long-press when it has no context menu of its
|
||||
* A window's answer to tap-then-hold when it has no context menu of its
|
||||
* own: open the system menu in its place, so both gestures land on the
|
||||
* same menu. Ignored unless the window is still the foreground one.
|
||||
*/
|
||||
@@ -1197,9 +1223,9 @@ class Shell {
|
||||
* The system/escape menu: the entries every window shares (Focus app
|
||||
* switcher, Voice input, Close window) plus Debug. Shell-owned and
|
||||
* shell-drawn (never the app's), so an unresponsive app can always be
|
||||
* closed. It opens for tap-then-hold, after an extended hold (over whatever
|
||||
* the app did with the ordinary long-press, including opening its own
|
||||
* menu), and on a window's request when it has no menu of its own.
|
||||
* closed. It opens for long-press (over the app's own menu too), after an
|
||||
* extended hold in a window that claims long-press, and on a window's
|
||||
* request when tap-then-hold finds it has no menu of its own.
|
||||
*/
|
||||
private openEscapeMenu(): void {
|
||||
if (!this.screenOn || this.activeVoiceLayer || !this.stack.isAtBase()) return;
|
||||
@@ -1249,11 +1275,11 @@ class Shell {
|
||||
this.openToolDebugDialog();
|
||||
},
|
||||
});
|
||||
// Gesture help: a long-press switches to the app's own context menu, when
|
||||
// the app has one (otherwise it either does something app-specific or
|
||||
// opens this very menu, neither worth a hint).
|
||||
// Gesture help: tap-then-hold switches to the app's own context menu,
|
||||
// when the app has one (otherwise it opens this very menu, not worth a
|
||||
// hint).
|
||||
const footer = foreground.hasAppMenu?.()
|
||||
? gestureHints([[GESTURE_LONG_PRESS, "app menu"]])
|
||||
? gestureHints([[GESTURE_SHORT_THEN_LONG_PRESS, "app menu"]])
|
||||
: undefined;
|
||||
layer = new ShellOverlayMenuLayer(items, footer, () => this.yieldFocusToSidebar());
|
||||
layer.selectItem(initialSelection);
|
||||
|
||||
@@ -73,7 +73,7 @@ export type WorkerAppReply =
|
||||
}
|
||||
| {
|
||||
/**
|
||||
* The window's answer to a long-press when it has no context menu of
|
||||
* The window's answer to tap-then-hold when it has no context menu of
|
||||
* its own: open the shell's system menu in its place.
|
||||
*/
|
||||
type: "open-system-menu";
|
||||
@@ -81,13 +81,16 @@ export type WorkerAppReply =
|
||||
}
|
||||
| {
|
||||
/**
|
||||
* Whether a long-press currently opens the window's own context menu
|
||||
* (with something in it). Posted on change; the shell's system menu
|
||||
* shows its "long-press: app menu" hint only while this is true.
|
||||
* The window's current gesture bindings, posted on change. hasAppMenu:
|
||||
* tap-then-hold opens a context menu with something in it (the system
|
||||
* menu shows its app-menu hint only then). claimsLongPress: the app
|
||||
* gives long-press a meaning of its own, so the shell forwards it
|
||||
* rather than opening the system menu (see ShellWindow).
|
||||
*/
|
||||
type: "set-app-menu-available";
|
||||
type: "set-window-gestures";
|
||||
windowId: string;
|
||||
available: boolean;
|
||||
hasAppMenu: boolean;
|
||||
claimsLongPress: boolean;
|
||||
}
|
||||
| {
|
||||
/** Open or focus the Settings app, optionally jumping to a section. */
|
||||
@@ -190,8 +193,8 @@ const TOOL_CALL_HOST_TIMEOUT_MS = 15_000;
|
||||
|
||||
export class WorkerAppHost {
|
||||
private readonly openWindows = new Set<string>();
|
||||
/** Windows that reported a context menu of their own (see set-app-menu-available). */
|
||||
private readonly appMenuAvailable = new Set<string>();
|
||||
/** Per-window gesture bindings, as last reported (see set-window-gestures). */
|
||||
private readonly windowGestures = new Map<string, { hasAppMenu: boolean; claimsLongPress: boolean }>();
|
||||
private readonly pendingToolCalls = new Map<string, PendingToolCall>();
|
||||
private nextCallSerial = 1;
|
||||
/**
|
||||
@@ -266,12 +269,11 @@ export class WorkerAppHost {
|
||||
shell.openSystemMenu(message.windowId);
|
||||
}
|
||||
break;
|
||||
case "set-app-menu-available":
|
||||
if (message.available) {
|
||||
this.appMenuAvailable.add(message.windowId);
|
||||
} else {
|
||||
this.appMenuAvailable.delete(message.windowId);
|
||||
}
|
||||
case "set-window-gestures":
|
||||
this.windowGestures.set(message.windowId, {
|
||||
hasAppMenu: message.hasAppMenu,
|
||||
claimsLongPress: message.claimsLongPress,
|
||||
});
|
||||
break;
|
||||
case "open-settings":
|
||||
this.options.openSettings(message.section);
|
||||
@@ -346,10 +348,11 @@ export class WorkerAppHost {
|
||||
closeable: true,
|
||||
acceptsDirectional: spec.acceptsDirectional,
|
||||
heightMode,
|
||||
hasAppMenu: () => this.appMenuAvailable.has(spec.windowId),
|
||||
hasAppMenu: () => this.windowGestures.get(spec.windowId)?.hasAppMenu ?? false,
|
||||
claimsLongPress: () => this.windowGestures.get(spec.windowId)?.claimsLongPress ?? false,
|
||||
close: () => {
|
||||
this.openWindows.delete(spec.windowId);
|
||||
this.appMenuAvailable.delete(spec.windowId);
|
||||
this.windowGestures.delete(spec.windowId);
|
||||
// Withdraw this window's tools and fail any in-flight calls to it.
|
||||
toolRegistry.removeAppTools(spec.windowId);
|
||||
this.failPendingToolCallsFor(spec.windowId);
|
||||
|
||||
+37
-29
@@ -1,19 +1,19 @@
|
||||
import { GrayImage } from "../graphics/image";
|
||||
import { singlePlane, type Plane } from "../graphics/plane";
|
||||
import { GESTURE_SHORT_THEN_LONG_PRESS, gestureHints, type InputEvent } from "./gestures";
|
||||
import { GESTURE_LONG_PRESS, gestureHints, type InputEvent } from "./gestures";
|
||||
import { type Layer, LayerStack, noopLayerActions } from "./layers";
|
||||
import { MenuLayer, type MenuItem, type MenuLayout } from "./menu";
|
||||
import type { WorkerAppReply } from "./shell/worker-window";
|
||||
|
||||
/**
|
||||
* The window long-press menu: an app's own context menu, holding its
|
||||
* app-specific actions. The shell's system menu (tap-then-hold, or a press
|
||||
* held past the escape threshold) carries the entries every window shares —
|
||||
* Focus app switcher, Voice input, Close window — so an app with nothing of
|
||||
* its own to offer has no menu of its own: a long-press then opens the system
|
||||
* menu in its place, so both gestures land on the same menu. The system menu
|
||||
* is also the safety net: shell-owned, so an unresponsive app can always be
|
||||
* closed.
|
||||
* The window context menu, opened by tap-then-hold: an app's own menu,
|
||||
* holding its app-specific actions. The shell's system menu (long-press)
|
||||
* carries the entries every window shares — Focus app switcher, Voice input,
|
||||
* Close window — so an app with nothing of its own to offer has no menu of
|
||||
* its own: tap-then-hold then opens the system menu in its place, so both
|
||||
* gestures land on the same menu. The system menu is also the safety net:
|
||||
* shell-owned, so an unresponsive app can always be closed (a window that
|
||||
* claims long-press for a move of its own reaches it by holding the press).
|
||||
*/
|
||||
|
||||
/** Centered over the viewport; visually matches the shell's system menu position. */
|
||||
@@ -22,7 +22,7 @@ export const WINDOW_MENU_LAYOUT: MenuLayout = {
|
||||
y: 8,
|
||||
width: 272,
|
||||
minHeight: 150,
|
||||
footer: gestureHints([[GESTURE_SHORT_THEN_LONG_PRESS, "system menu"]]),
|
||||
footer: gestureHints([[GESTURE_LONG_PRESS, "system menu"]]),
|
||||
};
|
||||
|
||||
export class WindowMenuLayer extends MenuLayer {
|
||||
@@ -38,16 +38,17 @@ export type WindowMenuOptions = {
|
||||
title: () => string;
|
||||
/**
|
||||
* The app's menu entries, built at open time so they reflect current
|
||||
* state. Empty means the window has no context menu: open() asks the shell
|
||||
* for the system menu instead.
|
||||
* state. Empty means the window has no context menu right now: open()
|
||||
* asks the shell for the system menu instead.
|
||||
*/
|
||||
items: () => MenuItem[];
|
||||
/**
|
||||
* False while the app gives long-press a meaning of its own (a game move)
|
||||
* instead of opening this menu. Default: always true. Only informs the
|
||||
* shell's system-menu hint; what a long-press does stays the app's call.
|
||||
* True while the app gives long-press a meaning of its own (a game move).
|
||||
* The shell then forwards long-presses to the window instead of opening
|
||||
* the system menu on them; holding the press past the escape threshold
|
||||
* still reaches the system menu. Default: never.
|
||||
*/
|
||||
longPressOpensMenu?: () => boolean;
|
||||
claimsLongPress?: () => boolean;
|
||||
/** Paint the window content the menu draws over (a fresh, mutable image). */
|
||||
paintBase: () => GrayImage;
|
||||
size: { width: number; height: number };
|
||||
@@ -59,14 +60,15 @@ export type WindowMenuOptions = {
|
||||
* a persistent LayerStack. Wraps a short-lived stack so MenuLayer (and the
|
||||
* ctx.stack.pop() convention in item callbacks) works unchanged.
|
||||
*
|
||||
* Usage: answer a long-press with open(); route input to handleInput while
|
||||
* Usage: answer tap-then-hold with open(); route input to handleInput while
|
||||
* isOpen(); paint every frame through paint(), which returns the window
|
||||
* content with the menu drawn over it and keeps the shell told whether the
|
||||
* window currently has a menu (the system menu's gesture hint depends on it).
|
||||
* content with the menu drawn over it and keeps the shell told about the
|
||||
* window's gesture bindings (whether it has a menu, whether it claims
|
||||
* long-press).
|
||||
*/
|
||||
export class WindowMenu {
|
||||
private stack: LayerStack | null = null;
|
||||
private reportedAvailable: boolean | null = null;
|
||||
private reported: { hasAppMenu: boolean; claimsLongPress: boolean } | null = null;
|
||||
|
||||
constructor(private readonly options: WindowMenuOptions) {}
|
||||
|
||||
@@ -74,9 +76,9 @@ export class WindowMenu {
|
||||
return this.stack !== null;
|
||||
}
|
||||
|
||||
/** True when a long-press currently opens this menu with something in it. */
|
||||
/** True when tap-then-hold currently opens this menu with something in it. */
|
||||
isAvailable(): boolean {
|
||||
return (this.options.longPressOpensMenu?.() ?? true) && this.options.items().length > 0;
|
||||
return this.options.items().length > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,17 +107,23 @@ export class WindowMenu {
|
||||
* ordinary frame has more planes than the menu needs beneath it.
|
||||
*/
|
||||
paint(content?: () => Plane[]): Plane[] {
|
||||
this.syncAvailability();
|
||||
this.syncGestures();
|
||||
if (this.stack) return this.stack.paint();
|
||||
return content ? content() : singlePlane(this.options.paintBase());
|
||||
}
|
||||
|
||||
/** Tell the shell when this window gains or loses its context menu. */
|
||||
private syncAvailability(): void {
|
||||
const available = this.isAvailable();
|
||||
if (available === this.reportedAvailable) return;
|
||||
this.reportedAvailable = available;
|
||||
this.options.post({ type: "set-app-menu-available", windowId: this.options.windowId, available });
|
||||
/** Tell the shell when this window's gesture bindings change. */
|
||||
private syncGestures(): void {
|
||||
const hasAppMenu = this.isAvailable();
|
||||
const claimsLongPress = this.options.claimsLongPress?.() ?? false;
|
||||
if (this.reported?.hasAppMenu === hasAppMenu && this.reported.claimsLongPress === claimsLongPress) return;
|
||||
this.reported = { hasAppMenu, claimsLongPress };
|
||||
this.options.post({
|
||||
type: "set-window-gestures",
|
||||
windowId: this.options.windowId,
|
||||
hasAppMenu,
|
||||
claimsLongPress,
|
||||
});
|
||||
}
|
||||
|
||||
/** Route an input event to the menu; the menu closes by popping itself. */
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ answered on `/faceclaw/ack`.
|
||||
|
||||
| Path | Payload | Effect |
|
||||
| --- | --- | --- |
|
||||
| `/faceclaw/input` | `{gesture, steps?}` | A ring gesture through the same path as the phone UI's test buttons. `gesture` ∈ `click`, `double-click`, `scroll-up`, `scroll-down`, `long-press` (complete short hold), `long-press-start`, `long-press-release`, `short-then-long-press` (tap then hold: the glasses' system menu), `wakeword` ("Hey Even"), `swipe-up`, `swipe-down`, `swipe-left`, `swipe-right` (spatial input only a watch can produce: delivered to the glasses UI as `swipe-*` events for components that navigate spatially — launcher grid, settings columns, sidebar, Music — with a scroll / click / double-click fallback elsewhere). `steps` (1–12) repeats a scroll. Refused while the glasses are disconnected. The lock screen is honoured exactly as for the ring. While the display is off, only a double-click is accepted and it wakes the display. |
|
||||
| `/faceclaw/input` | `{gesture, steps?}` | A ring gesture through the same path as the phone UI's test buttons. `gesture` ∈ `click`, `double-click`, `scroll-up`, `scroll-down`, `long-press` (complete short hold), `long-press-start`, `long-press-release`, `short-then-long-press` (tap then hold: the app's context menu; a plain `long-press` is the glasses' system menu), `wakeword` ("Hey Even"), `swipe-up`, `swipe-down`, `swipe-left`, `swipe-right` (spatial input only a watch can produce: delivered to the glasses UI as `swipe-*` events for components that navigate spatially — launcher grid, settings columns, sidebar, Music — with a scroll / click / double-click fallback elsewhere). `steps` (1–12) repeats a scroll. Refused while the glasses are disconnected. The lock screen is honoured exactly as for the ring. While the display is off, only a double-click is accepted and it wakes the display. |
|
||||
| `/faceclaw/command` | `{command, …}` | `launch-app {appId}`, `focus-window {windowId}`, `close-window {windowId}`, `sidebar`, `wake`, `sleep`, `lock`, `unlock`, `connect`, `disconnect`, `close-assistant`, `display-mode {value}` (`value` ∈ `576x288`, `576x480`, `640x480`; sets the phone's Display > Display mode). Everything but connect/disconnect needs a connection; everything but lock/unlock is refused while locked; `unlock` also needs the phone's "Watch can unlock glasses" setting. |
|
||||
| `/faceclaw/assistant` | `{text}` | Send a query to the assistant (`shell.sendToAssistant`) — the reply shows on the glasses and streams back to the watch as events. |
|
||||
| `/faceclaw/text` | `{text}` | Type text into the foreground window (`receiveTextInput`, e.g. the terminal). Refused when the window doesn't take text. |
|
||||
|
||||
+2
-1
@@ -13,7 +13,8 @@ the phone it only tells you to install it.
|
||||
| --- | --- |
|
||||
| tap | select |
|
||||
| double-tap, or a two-finger tap | **back**, everywhere: closes menus, leaves a settings column, leaves a folder or the launcher grid, returns to the sidebar (and from the sidebar turns the display off, as the ring does) |
|
||||
| press and hold | the app's context menu (a long press, held until you lift your finger) |
|
||||
| press and hold | the system menu: Focus app switcher, Voice input, Close window (a long press, held until you lift your finger; games that use a long press as a move get it instead) |
|
||||
| tap, then press and hold | the app's context menu |
|
||||
| swipe ↑ ↓ ← → | **spatial navigation, with no mode to enter first**: the launcher highlights one app and the swipe moves it by a row or a column; the settings panel moves between its columns and down its lists; the sidebar moves up and down; Music skips to the previous / next track. Right goes *into* things (sidebar → window, section → items) and left comes back *out* (first column → sidebar). Anywhere without a spatial meaning, up/down scroll, right selects and left goes back. One step per swipe (long swipes used to repeat, which overshot lists whenever the display lagged); use repeated flicks, the crown, or a two-finger page swipe to cover distance. |
|
||||
| rotate the crown | previous / next (one step per detent-ish, sensitivity adjustable) — clockwise is previous by default; reverse it in the on-glasses Settings > Watch section |
|
||||
| two-finger swipe up / down | scroll a page (3 steps) |
|
||||
|
||||
@@ -34,7 +34,7 @@ enum class Gesture(val wire: String) {
|
||||
/** Finger down: the hold lasts until LONG_PRESS_RELEASE. */
|
||||
LONG_PRESS_START("long-press-start"),
|
||||
LONG_PRESS_RELEASE("long-press-release"),
|
||||
/** Tap then hold: opens the glasses' system menu (G2 2.2.9 gesture). */
|
||||
/** Tap then hold: opens the app's context menu on the glasses (G2 2.2.9 gesture). */
|
||||
SHORT_THEN_LONG_PRESS("short-then-long-press"),
|
||||
/** The spoken "Hey Even": opens the glasses' own voice dialog. */
|
||||
WAKEWORD("wakeword"),
|
||||
|
||||
Reference in new issue
Block a user