Path: blob/main/src/vs/editor/browser/config/tabFocus.ts
3294 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';67class TabFocusImpl {8private _tabFocus: boolean = false;9private readonly _onDidChangeTabFocus = new Emitter<boolean>();10public readonly onDidChangeTabFocus: Event<boolean> = this._onDidChangeTabFocus.event;1112public getTabFocusMode(): boolean {13return this._tabFocus;14}1516public setTabFocusMode(tabFocusMode: boolean): void {17this._tabFocus = tabFocusMode;18this._onDidChangeTabFocus.fire(this._tabFocus);19}20}2122/**23* Control what pressing Tab does.24* If it is false, pressing Tab or Shift-Tab will be handled by the editor.25* If it is true, pressing Tab or Shift-Tab will move the browser focus.26* Defaults to false.27*/28export const TabFocus = new TabFocusImpl();293031