The Rust backend emits events to windows usingDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/devv-shayan/Trueears/llms.txt
Use this file to discover all available pages before exploring further.
app.emit(...) or window.emit(...). The frontend subscribes with listen from @tauri-apps/api/event.
Listening to events
Always store the
unlisten function returned by listen() and call it on component unmount or when the listener is no longer needed. Failing to do so will cause memory leaks and duplicate event handlers.Available events
shortcut-pressed
Triggered when the user presses the global recording shortcut (Ctrl+Shift+K on Windows/Linux, Cmd+Shift+K on macOS). The payload includes the active window information and any pre-selected text captured at the moment the shortcut was pressed.
Payload:
shortcut-released
Triggered when the user releases the global recording shortcut key. Used in Push-to-Talk mode to stop recording automatically on key release.
Payload: null
shortcut-cancelled
Triggered when the user presses Escape while the overlay is visible (and the Escape shortcut is registered). The frontend uses this to abort the current recording and discard audio.
Payload: null
The Escape shortcut is only registered while the overlay is visible. Call
register_escape_shortcut when recording starts and unregister_escape_shortcut when it ends.settings-changed
Emitted after a successful call to set_store_value. All open windows receive this event so they can re-read any settings they depend on.
Payload: null
onboarding-trigger-state
Emitted after a call to set_onboarding_trigger_active. When true, the normal shortcut-pressed handler should be suppressed so the hotkey triggers the onboarding step instead of dictation.
Payload: boolean
onboarding-trigger
Emitted to the main window when the recording shortcut is pressed while onboarding trigger mode is active (i.e., ONBOARDING_TRIGGER_ACTIVE is true). Used by the onboarding flow to detect that the user has pressed the hotkey as instructed.
Payload: null
auth-success
Emitted after a successful Google OAuth login. Carries the authenticated user’s profile.
Payload: UserInfo
auth-error
Emitted when the Google OAuth flow fails (e.g., the user cancels in the browser, or the token exchange fails).
Payload: string (error message)
show-warning
Emitted by transcription_complete when the automatic paste cannot complete (e.g., on a Wayland session where enigo-based key injection is blocked). The payload is a human-readable message to display to the user.
Payload: string (warning message)
React cleanup pattern
In a React component, set up listeners in auseEffect and return the unlisten function as the cleanup:
