injectHardwareButton
Inject a capture-button press to pause, resume, or stop the simulated glasses camera stream. Test app handling of paused or stopped camera states end-to-end.
Instructions
Press the simulated glasses' hardware CAPTURE BUTTON (the right-temple controls) — the agent's way to exercise the wearer's hardware privacy gestures with no human and no hardware. Tap on a LIVE camera stream pauses it; a second tap resumes. While paused, every stream-needing capture (capturePhoto — both mechanisms —, captureVideo, videoFrames) fails with CaptureError.StreamPaused carrying the actionable "tap the right temple to resume" message, and a capture_denied row lands in getEventLog(filter: 'errors') — the same behavior a wearer's temple tap produces on real glasses, because it IS the same shared gate. Hold STOPS the stream (camera_stream_closed): on real glasses the hold stops the whole device session — the connection drops and the SDK auto-recovers over ~3-5s; the sim closes the stream and deliberately skips the connection blip (a surfaced substrate delta) — the next frame-grab photo / video / videoFrames use re-arms it. The stream-state transitions land as camera_stream_opened / camera_stream_paused / camera_stream_resumed / camera_stream_closed under filter 'camera', and the sim page's capture LED tracks them (lit = streaming, dark = paused/closed); videoFrames delivery halts while paused and dies on close. A gesture with NO live stream is invisible to the app (hardware-faithful — it falls through to Meta's first-party capture, which DAT apps never see): arm the stream first. Mirrors the sim page's Hardware-buttons panel — same hub path, identical downstream. Typical loop: createSimulatorSession → ensureSimulatorBrowser → setSimVideo → (app takes a photo — stream arms) → injectHardwareButton (pause) → drive a capture → getEventLog(filter: 'errors') shows capture_denied → injectHardwareButton (resume) → capture succeeds. USE to test paused/stopped-camera handling end-to-end. DON'T USE for display input (injectInput), voice (injectTranscript), or hardware alerts like thermal/hinges (those inject via the sim page).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | The press gesture. 'tap' = pause/resume toggle (StreamState PAUSED; no app-callable resume). 'hold' = stop the stream (on hardware the whole device session stops and the SDK auto-recovers; in the sim the stream closes and the next camera use re-arms it). This is the complete gesture set the glasses' capture button produces for third-party streams. Defaults to 'tap'. | |
| button | No | Which hardware button to press. 'capture' (the right-temple capture button) only — the one button whose effect DAT surfaces to third-party apps. Defaults to 'capture'. | |
| sessionId | Yes |