Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/base/common/ime.ts
3292 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 } from './event.js';
7
8
export class IMEImpl {
9
10
private readonly _onDidChange = new Emitter<void>();
11
public readonly onDidChange = this._onDidChange.event;
12
13
private _enabled = true;
14
15
public get enabled() {
16
return this._enabled;
17
}
18
19
/**
20
* Enable IME
21
*/
22
public enable(): void {
23
this._enabled = true;
24
this._onDidChange.fire();
25
}
26
27
/**
28
* Disable IME
29
*/
30
public disable(): void {
31
this._enabled = false;
32
this._onDidChange.fire();
33
}
34
}
35
36
export const IME = new IMEImpl();
37
38