fires callback when a key is pressed
function useKeyStroke(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: KeyOptions): void
useKeyStroke(true, (e: KeyboardEvent
e) => {
// code goes here
})
type KeyStrokeEventName = "keydown" | "keypress" | "keyup"
type KeyOptions = {
eventName?: KeyStrokeEventName
ref?: (() => EventTarget | null) | null
passive?: boolean
repeat?: boolean
}