{"record":{"id":"f5d15e6337dbdb93","repo":"tinyhumansai/openhuman","slug":"ptt-hotkey-un-register-failed","errorCode":null,"errorMessage":"[ptt] hotkey (un)register failed","messagePattern":"\\[ptt\\] hotkey \\(un\\)register failed","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/hooks/usePttHotkey.ts","lineNumber":42,"sourceCode":"  useEffect(() => {\n    dispatch(setIsHeld(false));\n  }, [dispatch]);\n\n  useEffect(() => {\n    let cancelled = false;\n    const apply = async () => {\n      try {\n        if (shortcut && shortcut.trim().length > 0) {\n          await registerPttHotkey(shortcut);\n          if (!cancelled) dispatch(setPttRegistrationError(null));\n        } else {\n          await unregisterPttHotkey();\n          if (!cancelled) dispatch(setPttRegistrationError(null));\n        }\n      } catch (err) {\n        if (!cancelled) {\n          const msg = err instanceof Error ? err.message : String(err);\n          console.warn('[ptt] hotkey (un)register failed', err);\n          dispatch(setPttRegistrationError(msg));\n        }\n      }\n    };\n    void apply();\n    return () => {\n      cancelled = true;\n    };\n  }, [shortcut, dispatch]);\n}\n","sourceCodeStart":24,"sourceCodeEnd":53,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/hooks/usePttHotkey.ts#L24-L53","documentation":"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.","triggerScenarios":"Thrown at app/src/hooks/usePttHotkey.ts:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check OS permissions (macOS Accessibility/Input Monitoring) for global hotkeys","Choose a shortcut not already claimed by another app","Clear pttRegistrationError by re-saving a valid shortcut once registration succeeds"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}