- useKeyDown(key: string, handler: ((down: boolean, e: KeyboardEvent) => void), deps?: DependencyList): void
-
Parameters
-
key: string
-
handler: ((down: boolean, e: KeyboardEvent) => void)
-
- (down: boolean, e: KeyboardEvent): void
-
Parameters
-
down: boolean
-
e: KeyboardEvent
Returns void
-
deps: DependencyList = []
Returns void
a react hook that calls the handler when a given key is down