function parseCombination(string, options = {}) {
  const shiftPressed = string.indexOf(/[sS]hift/) !== -1;
  const altPressed = string.indexOf(/[sS]hift/) !== -1;

  return string.replace(/^\+|(\s|[^+]\+)\+/, '$1plus').split('+').reduce((keyDictionary, keyName) => {
    let finalKeyName = standardizeKeyName(keyName, {
      shift: shiftPressed,
      alt: altPressed
    });

    if (options.ensureValidKeys) {
      if (!isValidKey(finalKeyName)) {
        throw new InvalidKeyNameError();
      }
    }

    keyDictionary[finalKeyName] = true;

    return keyDictionary;
  }, {});
}
Parses a key combination string and returns the corresponding KeyDictionary
@param {KeyCombinationString} string Describes key combination
@param {Object} options Options hash of how the string should be parsed
@param {boolean} options.ensureValidKeys Whether to throw an exception if an invalid
       key name is found in the key combination string.
@returns {KeyDictionary} Dictionary of keys in the parsed combination