/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ export class KeybindingParser { public static _readModifiers(input: string) { input = input.toLowerCase().trim(); let ctrl = false; let shift = false; let alt = false; let meta = false; let key: string; const firstSpaceIdx = input.indexOf(' '); if (firstSpaceIdx > 0) { key = input.substring(0, firstSpaceIdx); input = input.substring(firstSpaceIdx); } else { key = input; input = ''; } return { remains: input, ctrl, shift, alt, meta, key }; } }