當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript keyCodes.KeyCodeUtils類代碼示例

本文整理匯總了TypeScript中vs/base/common/keyCodes.KeyCodeUtils的典型用法代碼示例。如果您正苦於以下問題:TypeScript KeyCodeUtils類的具體用法?TypeScript KeyCodeUtils怎麽用?TypeScript KeyCodeUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了KeyCodeUtils類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: _getUserSettingsLabel

	protected _getUserSettingsLabel(keybinding: SimpleKeybinding): string | null {
		if (keybinding.isDuplicateModifierCase()) {
			return '';
		}
		const result = KeyCodeUtils.toUserSettingsUS(keybinding.keyCode);
		return (result ? result.toLowerCase() : result);
	}
開發者ID:PKRoma,項目名稱:vscode,代碼行數:7,代碼來源:usLayoutResolvedKeybinding.ts

示例2: _getAriaLabelForKeybinding

	private _getAriaLabelForKeybinding(keybinding: SimpleKeybinding): string {
		if (!keybinding) {
			return null;
		}
		if (keybinding.isDuplicateModifierCase()) {
			return '';
		}
		return KeyCodeUtils.toString(keybinding.keyCode);
	}
開發者ID:hungys,項目名稱:vscode,代碼行數:9,代碼來源:usLayoutResolvedKeybinding.ts

示例3: _getUserSettingsLabelForKeybinding

	private _getUserSettingsLabelForKeybinding(keybinding: SimpleKeybinding | null): string | null {
		if (!keybinding) {
			return null;
		}
		if (keybinding.isDuplicateModifierCase()) {
			return '';
		}
		return KeyCodeUtils.toUserSettingsUS(keybinding.keyCode);
	}
開發者ID:KTXSoftware,項目名稱:KodeStudio,代碼行數:9,代碼來源:usLayoutResolvedKeybinding.ts

示例4: parseSimpleUserBinding

	private static parseSimpleUserBinding(input: string): [SimpleKeybinding | ScanCodeBinding, string] {
		const mods = this._readModifiers(input);
		const scanCodeMatch = mods.key.match(/^\[([^\]]+)\]$/);
		if (scanCodeMatch) {
			const strScanCode = scanCodeMatch[1];
			const scanCode = ScanCodeUtils.lowerCaseToEnum(strScanCode);
			return [new ScanCodeBinding(mods.ctrl, mods.shift, mods.alt, mods.meta, scanCode), mods.remains];
		}
		const keyCode = KeyCodeUtils.fromUserSettings(mods.key);
		return [new SimpleKeybinding(mods.ctrl, mods.shift, mods.alt, mods.meta, keyCode), mods.remains];
	}
開發者ID:DonJayamanne,項目名稱:vscode,代碼行數:11,代碼來源:keybindingParser.ts

示例5: _keyCodeToUILabel

	private _keyCodeToUILabel(keyCode: KeyCode): string {
		if (this._os === OperatingSystem.Macintosh) {
			switch (keyCode) {
				case KeyCode.LeftArrow:
					return '←';
				case KeyCode.UpArrow:
					return '↑';
				case KeyCode.RightArrow:
					return '→';
				case KeyCode.DownArrow:
					return '↓';
			}
		}
		return KeyCodeUtils.toString(keyCode);
	}
開發者ID:hungys,項目名稱:vscode,代碼行數:15,代碼來源:usLayoutResolvedKeybinding.ts

示例6: _keyCodeToElectronAccelerator

	private _keyCodeToElectronAccelerator(keyCode: KeyCode): string {
		if (keyCode >= KeyCode.NUMPAD_0 && keyCode <= KeyCode.NUMPAD_DIVIDE) {
			// Electron cannot handle numpad keys
			return null;
		}

		switch (keyCode) {
			case KeyCode.UpArrow:
				return 'Up';
			case KeyCode.DownArrow:
				return 'Down';
			case KeyCode.LeftArrow:
				return 'Left';
			case KeyCode.RightArrow:
				return 'Right';
		}

		return KeyCodeUtils.toString(keyCode);
	}
開發者ID:hungys,項目名稱:vscode,代碼行數:19,代碼來源:usLayoutResolvedKeybinding.ts

示例7: getDispatchStr

	public static getDispatchStr(keybinding: SimpleKeybinding): string {
		if (keybinding.isModifierKey()) {
			return null;
		}
		let result = '';

		if (keybinding.ctrlKey) {
			result += 'ctrl+';
		}
		if (keybinding.shiftKey) {
			result += 'shift+';
		}
		if (keybinding.altKey) {
			result += 'alt+';
		}
		if (keybinding.metaKey) {
			result += 'meta+';
		}
		result += KeyCodeUtils.toString(keybinding.keyCode);

		return result;
	}
開發者ID:hungys,項目名稱:vscode,代碼行數:22,代碼來源:usLayoutResolvedKeybinding.ts

示例8: _getAriaLabel

	protected _getAriaLabel(keybinding: SimpleKeybinding): string | null {
		if (keybinding.isDuplicateModifierCase()) {
			return '';
		}
		return KeyCodeUtils.toString(keybinding.keyCode);
	}
開發者ID:PKRoma,項目名稱:vscode,代碼行數:6,代碼來源:usLayoutResolvedKeybinding.ts

示例9: parseSimpleKeybinding

	private static parseSimpleKeybinding(input: string): [SimpleKeybinding, string] {
		const mods = this._readModifiers(input);
		const keyCode = KeyCodeUtils.fromUserSettings(mods.key);
		return [new SimpleKeybinding(mods.ctrl, mods.shift, mods.alt, mods.meta, keyCode), mods.remains];
	}
開發者ID:DonJayamanne,項目名稱:vscode,代碼行數:5,代碼來源:keybindingParser.ts


注:本文中的vs/base/common/keyCodes.KeyCodeUtils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。