Path: blob/main/extensions/copilot/src/extension/prompts/node/test/fixtures/keybindingParser.ts
13406 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45export class KeybindingParser {67public static _readModifiers(input: string) {8input = input.toLowerCase().trim();910let ctrl = false;11let shift = false;12let alt = false;13let meta = false;14151617let key: string;1819const firstSpaceIdx = input.indexOf(' ');20if (firstSpaceIdx > 0) {21key = input.substring(0, firstSpaceIdx);22input = input.substring(firstSpaceIdx);23} else {24key = input;25input = '';26}2728return {29remains: input,30ctrl,31shift,32alt,33meta,34key35};36}37}383940