Skip to content

useKeyDown

Hook | Source Code


useKeyDown(key: string, handler: KeyEventHandler): void


Registers an event listener for the moment when a specific key is pressed.

The key to listen for.


The handler to invoke when the specified key is pressed.