Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/editor/browser/config/tabFocus.ts
3294 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Emitter, Event } from '../../../base/common/event.js';
7
8
class TabFocusImpl {
9
private _tabFocus: boolean = false;
10
private readonly _onDidChangeTabFocus = new Emitter<boolean>();
11
public readonly onDidChangeTabFocus: Event<boolean> = this._onDidChangeTabFocus.event;
12
13
public getTabFocusMode(): boolean {
14
return this._tabFocus;
15
}
16
17
public setTabFocusMode(tabFocusMode: boolean): void {
18
this._tabFocus = tabFocusMode;
19
this._onDidChangeTabFocus.fire(this._tabFocus);
20
}
21
}
22
23
/**
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
*/
29
export const TabFocus = new TabFocusImpl();
30
31