本文整理汇总了TypeScript中vs/base/common/keyCodes.BinaryKeybindings.hasShift方法的典型用法代码示例。如果您正苦于以下问题:TypeScript BinaryKeybindings.hasShift方法的具体用法?TypeScript BinaryKeybindings.hasShift怎么用?TypeScript BinaryKeybindings.hasShift使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vs/base/common/keyCodes.BinaryKeybindings
的用法示例。
在下文中一共展示了BinaryKeybindings.hasShift方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
function test(keybinding: ITestKeybinding, k: number): void {
keybinding = keybinding || { key: KeyCode.Unknown };
assert.equal(BinaryKeybindings.hasCtrlCmd(k), !!keybinding.ctrlCmd);
assert.equal(BinaryKeybindings.hasShift(k), !!keybinding.shift);
assert.equal(BinaryKeybindings.hasAlt(k), !!keybinding.alt);
assert.equal(BinaryKeybindings.hasWinCtrl(k), !!keybinding.winCtrl);
assert.equal(BinaryKeybindings.extractKeyCode(k), keybinding.key);
let chord = BinaryKeybindings.extractChordPart(k);
assert.equal(BinaryKeybindings.hasChord(k), !!keybinding.chord);
if (keybinding.chord) {
assert.equal(BinaryKeybindings.hasCtrlCmd(chord), !!keybinding.chord.ctrlCmd);
assert.equal(BinaryKeybindings.hasShift(chord), !!keybinding.chord.shift);
assert.equal(BinaryKeybindings.hasAlt(chord), !!keybinding.chord.alt);
assert.equal(BinaryKeybindings.hasWinCtrl(chord), !!keybinding.chord.winCtrl);
assert.equal(BinaryKeybindings.extractKeyCode(chord), keybinding.chord.key);
}
}