本文整理匯總了TypeScript中vs/base/common/keyCodes.KeyCodeUtils.toString方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript KeyCodeUtils.toString方法的具體用法?TypeScript KeyCodeUtils.toString怎麽用?TypeScript KeyCodeUtils.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/base/common/keyCodes.KeyCodeUtils
的用法示例。
在下文中一共展示了KeyCodeUtils.toString方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: _getAriaLabelForKeybinding
private _getAriaLabelForKeybinding(keybinding: SimpleKeybinding): string {
if (!keybinding) {
return null;
}
if (keybinding.isDuplicateModifierCase()) {
return '';
}
return KeyCodeUtils.toString(keybinding.keyCode);
}
示例2: _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);
}
示例3: _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);
}
示例4: 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;
}
示例5: _getAriaLabel
protected _getAriaLabel(keybinding: SimpleKeybinding): string | null {
if (keybinding.isDuplicateModifierCase()) {
return '';
}
return KeyCodeUtils.toString(keybinding.keyCode);
}