当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript StandardKeyboardEvent.equals方法代码示例

本文整理汇总了TypeScript中vs/base/browser/keyboardEvent.StandardKeyboardEvent.equals方法的典型用法代码示例。如果您正苦于以下问题:TypeScript StandardKeyboardEvent.equals方法的具体用法?TypeScript StandardKeyboardEvent.equals怎么用?TypeScript StandardKeyboardEvent.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vs/base/browser/keyboardEvent.StandardKeyboardEvent的用法示例。


在下文中一共展示了StandardKeyboardEvent.equals方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: StandardKeyboardEvent

			this._register(domEvent(window, 'keydown', true)((e: KeyboardEvent) => {
				const evt = new StandardKeyboardEvent(e);
				if (evt.equals(KeyCode.Enter) || evt.equals(KeyCode.Space)) {
					return;
				}

				let eventHandled = false;
				if (this.buttonGroup) {
					if (evt.equals(KeyMod.Shift | KeyCode.Tab) || evt.equals(KeyCode.LeftArrow)) {
						focusedButton = focusedButton + this.buttonGroup.buttons.length - 1;
						focusedButton = focusedButton % this.buttonGroup.buttons.length;
						this.buttonGroup.buttons[focusedButton].focus();
						eventHandled = true;
					} else if (evt.equals(KeyCode.Tab) || evt.equals(KeyCode.RightArrow)) {
						focusedButton++;
						focusedButton = focusedButton % this.buttonGroup.buttons.length;
						this.buttonGroup.buttons[focusedButton].focus();
						eventHandled = true;
					}
				}

				if (eventHandled) {
					EventHelper.stop(e, true);
				} else if (this.options.keyEventProcessor) {
					this.options.keyEventProcessor(evt);
				}
			}));
开发者ID:fly-fisher,项目名称:vscode,代码行数:27,代码来源:dialog.ts

示例2: StandardKeyboardEvent

		this.$el.on(DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
			let event = new StandardKeyboardEvent(e);
			let eventHandled = false;
			if (this.enabled && event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
				this.emit(DOM.EventType.CLICK, e);
				eventHandled = true;
			} else if (event.equals(KeyCode.Escape)) {
				this.$el.domBlur();
				eventHandled = true;
			}

			if (eventHandled) {
				DOM.EventHelper.stop(event, true);
			}
		});
开发者ID:Chan-PH,项目名称:vscode,代码行数:15,代码来源:button.ts

示例3: StandardKeyboardEvent

		this.$el.on(DOM.EventType.KEY_DOWN, (e: KeyboardEvent) => {
			let event = new StandardKeyboardEvent(e);
			let eventHandled = false;
			if (this.enabled && event.equals(CommonKeybindings.ENTER) || event.equals(CommonKeybindings.SPACE)) {
				this.emit(DOM.EventType.CLICK, e);
				eventHandled = true;
			} else if (event.equals(CommonKeybindings.ESCAPE)) {
				this.$el.domBlur();
				eventHandled = true;
			}

			if (eventHandled) {
				DOM.EventHelper.stop(event, true);
			}
		});
开发者ID:AjuanM,项目名称:vscode,代码行数:15,代码来源:button.ts

示例4: StandardKeyboardEvent

		this._headerTabListener = DOM.addDisposableListener(this.header, DOM.EventType.KEY_DOWN, (e) => {
			let event = new StandardKeyboardEvent(e);
			if (event.equals(KeyCode.Tab) && this.state === CollapsibleState.EXPANDED) {
				let element = this._table.getSelectedRows();
				if (!element || element.length === 0) {
					this._table.setSelectedRows([0]);
					this._table.setActiveCell(0, 1);
					e.stopImmediatePropagation();
				}
			}
		});
开发者ID:burhandodhy,项目名称:azuredatastudio,代码行数:11,代码来源:tableView.ts

示例5: StandardKeyboardEvent

			this._register(domEvent(this.element, 'keydown', true)((e: KeyboardEvent) => {
				const evt = new StandardKeyboardEvent(e);
				if (evt.equals(KeyCode.Enter)) {
					return;
				}

				if (this.buttonGroup) {
					if ((evt.shiftKey && evt.equals(KeyCode.Tab)) || evt.equals(KeyCode.LeftArrow)) {
						focusedButton = focusedButton + this.buttonGroup.buttons.length - 1;
						focusedButton = focusedButton % this.buttonGroup.buttons.length;
						this.buttonGroup.buttons[focusedButton].focus();
					} else if (evt.equals(KeyCode.Tab) || evt.equals(KeyCode.RightArrow)) {
						focusedButton++;
						focusedButton = focusedButton % this.buttonGroup.buttons.length;
						this.buttonGroup.buttons[focusedButton].focus();
					}
				}

				EventHelper.stop(e, true);
			}));
开发者ID:joelday,项目名称:vscode,代码行数:20,代码来源:dialog.ts

示例6: StandardKeyboardEvent

		this.headerKeyListener = dom.addDisposableListener(this.header, dom.EventType.KEY_DOWN, (e) => {
			let event = new StandardKeyboardEvent(e);
			let eventHandled = false;
			if (event.equals(CommonKeybindings.ENTER) || event.equals(CommonKeybindings.SPACE) || (event.equals(CommonKeybindings.LEFT_ARROW) && this.state === CollapsibleState.EXPANDED) || (event.equals(CommonKeybindings.RIGHT_ARROW) && this.state === CollapsibleState.COLLAPSED)) {
				this.toggleExpansion();
				eventHandled = true;
			} else if (event.equals(CommonKeybindings.ESCAPE)) {
				this.header.blur();
				eventHandled = true;
			} else if (event.equals(CommonKeybindings.UP_ARROW)) {
				this.emit('focusPrevious');
				eventHandled = true;
			} else if (event.equals(CommonKeybindings.DOWN_ARROW)) {
				this.emit('focusNext');
				eventHandled = true;
			}

			if (eventHandled) {
				dom.EventHelper.stop(event, true);
			}
		});
开发者ID:578723746,项目名称:vscode,代码行数:21,代码来源:splitview.ts

示例7: StandardKeyboardEvent

		this._register(addDisposableListener(this._label, EventType.KEY_UP, e => {
			const event = new StandardKeyboardEvent(e);
			if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space)) {
				EventHelper.stop(e, true); // https://github.com/Microsoft/vscode/issues/57997

				if (this.visible) {
					this.hide();
				} else {
					this.show();
				}
			}
		}));
开发者ID:PKRoma,项目名称:vscode,代码行数:12,代码来源:dropdown.ts

示例8: StandardKeyboardEvent

		this.headerKeyListener = dom.addDisposableListener(this.header, dom.EventType.KEY_DOWN, (e) => {
			let event = new StandardKeyboardEvent(e);
			let eventHandled = false;
			if (event.equals(KeyCode.Enter) || event.equals(KeyCode.Space) || (event.equals(KeyCode.LeftArrow) && this.state === CollapsibleState.EXPANDED) || (event.equals(KeyCode.RightArrow) && this.state === CollapsibleState.COLLAPSED)) {
				this.toggleExpansion();
				eventHandled = true;
			} else if (event.equals(KeyCode.Escape)) {
				this.header.blur();
				eventHandled = true;
			} else if (event.equals(KeyCode.UpArrow)) {
				this.emit('focusPrevious');
				eventHandled = true;
			} else if (event.equals(KeyCode.DownArrow)) {
				this.emit('focusNext');
				eventHandled = true;
			}

			if (eventHandled) {
				dom.EventHelper.stop(event, true);
			}
		});
开发者ID:aminroosta,项目名称:vscode,代码行数:21,代码来源:splitview.ts


注:本文中的vs/base/browser/keyboardEvent.StandardKeyboardEvent.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。