Simulated Ring input is touchpad-style

This commit is contained in:
James Babcock committed 2026-08-30 19:50:37 -07:00
1 parent 602f66f15b
commit 01527adda9
3 files changed
+32 -22

No files matched your search

+4 -6
View File
@@ -264,12 +264,10 @@ Button.-primary {
margin: 2; margin: 2;
font-size: 14; font-size: 14;
} }
/* Ring tab: simulated R1 inputs. */ /* Ring tab: the same touchpad, but portrait like the ring's own pad. */
.ring-pad-button { .ring-touchpad {
margin: 3; width: 150;
padding: 0; height: 250;
height: 52;
font-size: 14;
} }
/* /*
* Pairing scan list (phone-ui/pairing-page). Rows are Repeater items: product * Pairing scan list (phone-ui/pairing-page). Rows are Repeater items: product
+15 -7
View File
@@ -12,7 +12,6 @@ import {
type View, type View,
} from "@nativescript/core"; } from "@nativescript/core";
import { dashboardController, type MirrorTouchKind } from "../g2/dashboard-controller"; import { dashboardController, type MirrorTouchKind } from "../g2/dashboard-controller";
import { shell } from "../ui/shell/shell";
import { import {
brightnessSetting, brightnessSetting,
DISPLAY_MODE_VALUES, DISPLAY_MODE_VALUES,
@@ -815,18 +814,27 @@ export class MainViewModel extends Observable {
await dashboardController.injectSyntheticRingInput("scroll-down"); await dashboardController.injectSyntheticRingInput("scroll-down");
} }
async onSyntheticLeftTap(): Promise<void> { async onRingPadTap(): Promise<void> {
await dashboardController.injectSyntheticRingInput("double-click");
}
async onSyntheticRightTap(): Promise<void> {
await dashboardController.injectSyntheticRingInput("click"); await dashboardController.injectSyntheticRingInput("click");
} }
async onSyntheticLongPressTap(): Promise<void> { async onRingPadDoubleTap(): Promise<void> {
await dashboardController.injectSyntheticRingInput("double-click");
}
async onRingPadLongPress(): Promise<void> {
await dashboardController.injectSyntheticRingInput("long-press"); await dashboardController.injectSyntheticRingInput("long-press");
} }
/** The ring pad only has a vertical axis, so left/right swipes are ignored. */
async onRingPadSwipe(args: SwipeGestureEventData): Promise<void> {
if (args.direction === SwipeDirection.up) {
await dashboardController.injectSyntheticRingInput("scroll-up");
} else if (args.direction === SwipeDirection.down) {
await dashboardController.injectSyntheticRingInput("scroll-down");
}
}
async onSyntheticMicTap(): Promise<void> { async onSyntheticMicTap(): Promise<void> {
await dashboardController.injectSyntheticRingInput("wakeword"); await dashboardController.injectSyntheticRingInput("wakeword");
} }
+13 -9
View File
@@ -2,8 +2,9 @@
The phone's controller for the glasses, as a three-tab area below the mirror: The phone's controller for the glasses, as a three-tab area below the mirror:
Settings (screen size + brightness), Watch (the simulated watch face: same Settings (screen size + brightness), Watch (the simulated watch face: same
scheme as the watch pad - tap = select, double-tap or two fingers = back, scheme as the watch pad - tap = select, double-tap or two fingers = back,
hold = menu, swipes navigate), and Ring (simulated R1 inputs on the ring's hold = menu, swipes navigate), and Ring (a touchpad on the ring's own
own scheme). The narrow mic button at the tab bar's right edge fires the scheme: vertical swipes scroll, tap/double-tap/hold = click/double-click/
long-press). The narrow mic button at the tab bar's right edge fires the
wakeword without changing the selected tab. Used by main-page.xml in both wakeword without changing the selected tab. Used by main-page.xml in both
orientations; binds to the page's MainViewModel, which collapses the whole orientations; binds to the page's MainViewModel, which collapses the whole
area while a text setting is being edited (keyboard-input mode). area while a text setting is being edited (keyboard-input mode).
@@ -61,12 +62,15 @@
</GridLayout> </GridLayout>
</StackLayout> </StackLayout>
<!-- Ring tab --> <!-- Ring tab: a touchpad on the ring's own scheme. Vertical swipes only
<GridLayout row="1" rows="auto,auto" columns="*,*,*" visibility="{{ ringTabVisibility }}" class="ring-grid"> (the ring has no horizontal axis) and no focus/status line; portrait
<Button row="0" col="0" text="▲ Up" tap="{{ onSyntheticUpTap }}" class="ring-pad-button" /> like the ring's pad itself, so the legend sits in the middle where the
<Button row="0" col="1" text="▼ Down" tap="{{ onSyntheticDownTap }}" class="ring-pad-button" /> watch pad keeps its focus line. -->
<Button row="0" col="2" text="● Click" tap="{{ onSyntheticRightTap }}" class="ring-pad-button" /> <GridLayout row="1" visibility="{{ ringTabVisibility }}" class="touchpad ring-touchpad"
<Button row="1" col="0" text="●● Double" tap="{{ onSyntheticLeftTap }}" class="ring-pad-button" /> horizontalAlignment="center" verticalAlignment="center"
<Button row="1" col="1" text="‒ Hold" tap="{{ onSyntheticLongPressTap }}" class="ring-pad-button" /> tap="{{ onRingPadTap }}" doubleTap="{{ onRingPadDoubleTap }}"
longPress="{{ onRingPadLongPress }}" swipe="{{ onRingPadSwipe }}">
<Button text="▲" tap="{{ onSyntheticUpTap }}" class="pad-dpad-button" horizontalAlignment="center" verticalAlignment="top" />
<Button text="▼" tap="{{ onSyntheticDownTap }}" class="pad-dpad-button" horizontalAlignment="center" verticalAlignment="bottom" />
</GridLayout> </GridLayout>
</GridLayout> </GridLayout>