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.
Fires
callbackwhen one ofkeyNames(default["Enter"]) is pressed anywhere in the document.Exposes raw
addEventListener/removeEventListenerrather than wiring its ownonMounted/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.