import { useKey as useReactUseKey } from 'react-use' ; export default function useKey ( filter , fn , deps ? ) { useReactUseKey ( filter , ( e ) => { if ( e . ctrlKey || e . altKey || e . metaKey || ( e . target instanceof HTMLInputElement && ( e . target . type === 'text' || e . target . type === 'number' ) ) || e . target instanceof HTMLSelectElement ) { return ; } fn ( e ) ; } , { } , deps ) ; }