Skip to content

useKeysPressed ​

Category
Sensors

Hook for get keys that were pressed

typescript
import { useKeysPressed } from '@siberiacancode/reactuse';

Usage ​

typescript
const pressedKeys = useKeysPressed();

Demo ​

Api ​

Parameters

NameTypeDefaultNote
params.target?UseEventListenerTargetwindowThe target to attach the event listeners to
params.enabled?booleanbolleanEnable or disable the event listeners

Contributors ​

Source • Demo