Components/useKeydown

useKeydown

Attach global keydown event listeners with cleanup.

Installation

Usage

API Reference

PropTypeDefaultDescription
key*string|string[]requiredKey or keys to listen for.
handler*(e: KeyboardEvent) => voidrequiredCalled when the key is pressed.
enabledbooleantrueDisable the listener without removing the hook.