nl_tokens: Determines whether the specified modifier keys match the modifier keys that were pressed .
pl_tokens: function isValidModifierKeyCombo ( modifierKeys , e ) { var modifierKeyNames = [ 'alt' , 'ctrl' , 'meta' , 'shift' ] , numModKeys = modifierKeys . length , i , j , currModifierKey , isValid = true ; // check that all required modifier keys were pressed for ( i = 0 ; i < numModKeys ; i += 1 ) { if ( ! e [ modifierKeys [ i ] ] ) { isValid = false ; break ; } } // if the requirements were met, check for additional modifier keys if ( isValid ) { for ( i = 0 ; i < modifierKeyNames . length ; i += 1 ) { currModifierKey = modifierKeyNames [ i ] + 'Key' ; // if this key was pressed if ( e [ currModifierKey ] ) { // if there are required keys, check whether the current key // is required if ( numModKeys ) { isValid = false ; // if this is a required key, continue for ( j = 0 ; j < numModKeys ; j += 1 ) { if ( currModifierKey === modifierKeys [ j ] ) { isValid = true ; break ; } } } else { // no required keys, but one was pressed isValid = false ; } } // an extra key was pressed, don't check anymore if ( ! isValid ) { <mask> ; } } } return isValid ; }