src/util/Callback.js
function (cb, key, shiftKey, ctrlKey) {
    var effectiveShiftKey = shiftKey || false;
    var effectiveCtrlKey = ctrlKey || false;
    return function (event) {
      var keyMatched = typeof key === 'string' ?
        event.key === key :
        Util.find(key, function (k) { return k === event.key; });

      if (keyMatched && event.shiftKey === effectiveShiftKey && event.ctrlKey === effectiveCtrlKey) {
        cb(event);
      }
    };
  }
function (cb, key, shiftKey, ctrlKey) {
    var effectiveShiftKey = shiftKey || false;
    var effectiveCtrlKey = ctrlKey || false;
    return function (event) {
      var keyMatched = typeof key === 'string' ?
        event.key === key :
        Util.find(key, function (k) { return k === event.key; });

      if (keyMatched && event.shiftKey === effectiveShiftKey && event.ctrlKey === effectiveCtrlKey) {
        cb(event);
      }
    };
  }
function ( cb , key , shiftKey , ctrlKey ) { var effectiveShiftKey = shiftKey || false ; var effectiveCtrlKey = ctrlKey || false ; return function ( event ) { var keyMatched = typeof key === 'string' ? event . key === key : Util . find ( key , function ( k ) { return k === event . key ; } ) ; if ( keyMatched && event . shiftKey === effectiveShiftKey && event . ctrlKey === effectiveCtrlKey ) { cb ( event ) ; } } ; }
Create callback invoked when specified key combination is pressed.
@param {Function} cb callback
@param {String|Array} key key
@param {Boolean} [shiftKey] shift key flag
@param {Boolean} [ctrlKey] ctrl key flag
@returns {Function} callback
@memberOf Callback
Create callback invoked when specified key combination is pressed .