forked from Blendman974/faceclaw
Add tokens and faceclaw-input script, which allows using a CLI utility as an input device for the glasses
This commit is contained in:
1 parent
313ba85708
commit
ccb320c66f
32 files changed
+1785
-12
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { startRemoteInput } from "../remote/service"
|
||||
import type { KeyboardInputSession } from '../ui/shell/keyboard-input'
|
||||
import { acceptInput, resetRingInputFilter } from "../ui/input-monitor";
|
||||
import { bindIosNotifications, iosNotificationsChanged, onIosNotificationPopup } from '../native/notification-icons.ios'
|
||||
@@ -170,6 +171,23 @@ export class IosPreviewController {
|
||||
shell.openNotificationModal(key, woke)
|
||||
this.requestShellRender()
|
||||
})
|
||||
startRemoteInput({
|
||||
ready: () => this.runtimeRunning,
|
||||
locked: () => this.glassesLocked,
|
||||
input: (gesture, source) => {
|
||||
// Share the controller queue with physical input. A discrete hold includes its release.
|
||||
const task = this.inputQueue.then(async () => {
|
||||
await this.receiveInput(makeInputEvent({ type: gesture, source } as InputEventPayload))
|
||||
if (gesture === 'long-press') await this.receiveInput(makeInputEvent({ type: 'long-press-release', source }))
|
||||
})
|
||||
this.inputQueue = task.catch(error => this.fail(error))
|
||||
return task
|
||||
},
|
||||
acceptsText: () => !!shell.foregroundWindow()?.receiveTextInput,
|
||||
text: (text, submit) => { if (!shell.isScreenOn()) shell.wake('window'); shell.sendTextToForegroundWindow(text, { submit }); this.requestShellRender() },
|
||||
assistantAvailable: () => shell.isAssistantAvailable(),
|
||||
assistant: text => shell.sendToAssistant(text),
|
||||
})
|
||||
registerSystemTools()
|
||||
registerWindowTools({ apps: ALL_APPS.filter(app => !iosAppUnavailableReason(app.appId)),
|
||||
launchApp: id => this.launchApp(id), requestShellRender: () => this.requestShellRender() })
|
||||
|
||||
Reference in new issue
Block a user