@polargold/pg-frontend-vue
    Preparing search index...

    Function useKeyboardEvent

    • Fires callback when one of keyNames (default ["Enter"]) is pressed anywhere in the document.

      Exposes raw addEventListener/removeEventListener rather than wiring its own onMounted/onUnmounted - of the three divergent copies found in the audit, this is the most flexible shape: the caller decides when to attach it (component lifecycle, a modal's open state, a Vue <Transition> hook, etc.) instead of the composable imposing one lifecycle policy.

      Parameters

      • callback: () => void
      • keyNames: string[] = ...

      Returns { addEventListener: () => void; removeEventListener: () => void }