import { KeyCombinations } from '@fluentui/accessibility' ; import * as keyboardKey from 'keyboard-key' ; import * as React from 'react' ; const isKeyModifiersMatch = ( modifierValue , combinationValue ? ) => { if ( combinationValue === undefined ) { return true ; } return modifierValue === combinationValue ; } ; const shouldHandleOnKeys = ( event , keysCombinations ) : boolean => keysCombinations . some ( keysCombination => keysCombination . keyCode === keyboardKey . getCode ( event ) && isKeyModifiersMatch ( event . altKey , keysCombination . altKey ) && isKeyModifiersMatch ( event . shiftKey , keysCombination . shiftKey ) && isKeyModifiersMatch ( event . metaKey , keysCombination . metaKey ) && isKeyModifiersMatch ( event . ctrlKey , keysCombination . ctrlKey ) ) ; export default shouldHandleOnKeys ;