當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。