import { useHtmlElementEventListener } from '../useHtmlElementEventListener' ; export const useKey = ( key , onHit , active ? , deps ? ) => { useHtmlElementEventListener ( document , 'keydown' , e => { if ( ! active ) { return ; } if ( active && key . toLowerCase ( ) === e . key . toLowerCase ( ) ) { onHit ( e ) ; } } , [ active , key , ... ( deps ?? [ ] ) ] ) ; } ;