lib/mousetrap.js
function _getKeyInfo(combination, action) {
  var keys,
      key,
      i,
      modifiers = [];

  // take the keys from this pattern and figure out what the actual
  // pattern is all about
  keys = _keysFromString(combination);

  for (i = 0; i < keys.length; ++i) {
    key = keys[i];

    // normalize key names
    if (_SPECIAL_ALIASES[key]) {
      key = _SPECIAL_ALIASES[key];
    }

    // if this is not a keypress event then we should
    // be smart about using shift keys
    // this will only work for US keyboards however
    if (action && action != 'keypress' && _SHIFT_MAP[key]) {
      key = _SHIFT_MAP[key];
      modifiers.push('shift');
    }

    // if this key is a modifier then add it to the list of modifiers
    if (_isModifier(key)) {
      modifiers.push(key);
    }
  }

  // depending on what the key combination is
  // we will try to pick the best event for it
  action = _pickBestAction(key, modifiers, action);

  return {
    key: key,
    modifiers: modifiers,
    action: action
  };
}
function _getKeyInfo(combination, action) {
  var keys,
      key,
      i,
      modifiers = [];

  // take the keys from this pattern and figure out what the actual
  // pattern is all about
  keys = _keysFromString(combination);

  for (i = 0; i < keys.length; ++i) {
    key = keys[i];

    // normalize key names
    if (_SPECIAL_ALIASES[key]) {
      key = _SPECIAL_ALIASES[key];
    }

    // if this is not a keypress event then we should
    // be smart about using shift keys
    // this will only work for US keyboards however
    if (action && action != 'keypress' && _SHIFT_MAP[key]) {
      key = _SHIFT_MAP[key];
      modifiers.push('shift');
    }

    // if this key is a modifier then add it to the list of modifiers
    if (_isModifier(key)) {
      modifiers.push(key);
    }
  }

  // depending on what the key combination is
  // we will try to pick the best event for it
  action = _pickBestAction(key, modifiers, action);

  return {
    key: key,
    modifiers: modifiers,
    action: action
  };
}
function _getKeyInfo ( combination , action ) { var keys , key , i , modifiers = [ ] ; // take the keys from this pattern and figure out what the actual // pattern is all about keys = _keysFromString ( combination ) ; for ( i = 0 ; i < keys . length ; ++ i ) { key = keys [ i ] ; // normalize key names if ( _SPECIAL_ALIASES [ key ] ) { key = _SPECIAL_ALIASES [ key ] ; } // if this is not a keypress event then we should // be smart about using shift keys // this will only work for US keyboards however if ( action && action != 'keypress' && _SHIFT_MAP [ key ] ) { key = _SHIFT_MAP [ key ] ; modifiers . push ( 'shift' ) ; } // if this key is a modifier then add it to the list of modifiers if ( _isModifier ( key ) ) { modifiers . push ( key ) ; } } // depending on what the key combination is // we will try to pick the best event for it action = _pickBestAction ( key , modifiers , action ) ; return { key : key , modifiers : modifiers , action : action } ; }
Gets info for a specific key combination

@param  {string} combination key combination ("command+s" or "a" or "*")
@param  {string=} action
@returns {Object}
Gets info for a specific key combination