Path: blob/main/src/vs/editor/browser/config/tabFocus.ts
5240 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { Emitter, Event } from '../../../base/common/event.js';6import { Disposable } from '../../../base/common/lifecycle.js';78class TabFocusImpl extends Disposable {9private _tabFocus: boolean = false;10private readonly _onDidChangeTabFocus = this._register(new Emitter<boolean>());11public readonly onDidChangeTabFocus: Event<boolean> = this._onDidChangeTabFocus.event;1213public getTabFocusMode(): boolean {14return this._tabFocus;15}1617public setTabFocusMode(tabFocusMode: boolean): void {18this._tabFocus = tabFocusMode;19this._onDidChangeTabFocus.fire(this._tabFocus);20}21}2223/**24* Control what pressing Tab does.25* If it is false, pressing Tab or Shift-Tab will be handled by the editor.26* If it is true, pressing Tab or Shift-Tab will move the browser focus.27* Defaults to false.28*/29export const TabFocus = new TabFocusImpl();303132