capture key combinations easily
Last updated 2 years ago
import { useKeyboard } from "@atomico/hooks/use-keyboard";
useKeyboard( ref: Ref<Element>, keysCode: string[], callback: (event: KeyboardEvent)=>void );
where:
ref, the reference to associate the event keydown and keyup.
keysCode: key combination to capture
callback: receives the last event of the key combination