tinyhumansai/openhuman · error

[ptt] hotkey (un)register failed

Error message

[ptt] hotkey (un)register failed

What it means

Failure of the PTT (push-to-talk) global hotkey (un)registration invoke in usePttHotkey: registering or unregistering the OS-level shortcut via the Tauri command rejected (invalid combo, OS accessibility permission missing, or hotkey already taken). The catch extracts the message and stores it in Redux as pttRegistrationError so the UI can show why PTT is unavailable.

Source

Thrown at app/src/hooks/usePttHotkey.ts:42

  useEffect(() => {
    dispatch(setIsHeld(false));
  }, [dispatch]);

  useEffect(() => {
    let cancelled = false;
    const apply = async () => {
      try {
        if (shortcut && shortcut.trim().length > 0) {
          await registerPttHotkey(shortcut);
          if (!cancelled) dispatch(setPttRegistrationError(null));
        } else {
          await unregisterPttHotkey();
          if (!cancelled) dispatch(setPttRegistrationError(null));
        }
      } catch (err) {
        if (!cancelled) {
          const msg = err instanceof Error ? err.message : String(err);
          console.warn('[ptt] hotkey (un)register failed', err);
          dispatch(setPttRegistrationError(msg));
        }
      }
    };
    void apply();
    return () => {
      cancelled = true;
    };
  }, [shortcut, dispatch]);
}

View on GitHub (pinned to 7491200858)

Solutions

  1. Check OS permissions (macOS Accessibility/Input Monitoring) for global hotkeys
  2. Choose a shortcut not already claimed by another app
  3. Clear pttRegistrationError by re-saving a valid shortcut once registration succeeds
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at app/src/hooks/usePttHotkey.ts:42 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/f5d15e6337dbdb93. Report an issue: GitHub.