@theia/monaco 1.53.0-next.55 → 1.53.0-next.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -100
- package/data/monaco-nls.json +1379 -1379
- package/data/monaco-themes/vscode/dark_plus.json +201 -201
- package/data/monaco-themes/vscode/dark_theia.json +5 -5
- package/data/monaco-themes/vscode/dark_vs.json +393 -393
- package/data/monaco-themes/vscode/hc_black.json +457 -457
- package/data/monaco-themes/vscode/hc_light.json +590 -590
- package/data/monaco-themes/vscode/hc_theia.json +5 -5
- package/data/monaco-themes/vscode/hc_theia_light.json +5 -5
- package/data/monaco-themes/vscode/light_plus.json +202 -202
- package/data/monaco-themes/vscode/light_theia.json +10 -10
- package/data/monaco-themes/vscode/light_vs.json +421 -421
- package/lib/browser/monaco-editor-zone-widget.js +1 -1
- package/lib/browser/monaco-frontend-application-contribution.js +25 -25
- package/lib/browser/simple-monaco-editor.d.ts +3 -1
- package/lib/browser/simple-monaco-editor.d.ts.map +1 -1
- package/lib/browser/simple-monaco-editor.js +9 -2
- package/lib/browser/simple-monaco-editor.js.map +1 -1
- package/package.json +8 -8
- package/src/browser/index.ts +17 -17
- package/src/browser/markdown-renderer/monaco-markdown-renderer.ts +109 -109
- package/src/browser/monaco-bulk-edit-service.ts +64 -64
- package/src/browser/monaco-color-registry.ts +73 -73
- package/src/browser/monaco-command-registry.ts +85 -85
- package/src/browser/monaco-command-service.ts +90 -90
- package/src/browser/monaco-command.ts +303 -303
- package/src/browser/monaco-context-key-service.ts +144 -144
- package/src/browser/monaco-context-menu.ts +112 -112
- package/src/browser/monaco-diff-editor.ts +141 -141
- package/src/browser/monaco-diff-navigator-factory.ts +39 -39
- package/src/browser/monaco-editor-model.ts +693 -693
- package/src/browser/monaco-editor-peek-view-widget.ts +233 -233
- package/src/browser/monaco-editor-provider.ts +455 -455
- package/src/browser/monaco-editor-service.ts +152 -152
- package/src/browser/monaco-editor-zone-widget.ts +250 -250
- package/src/browser/monaco-editor.ts +733 -733
- package/src/browser/monaco-formatting-conflicts.ts +116 -116
- package/src/browser/monaco-frontend-application-contribution.ts +182 -182
- package/src/browser/monaco-frontend-module.ts +319 -319
- package/src/browser/monaco-gotoline-quick-access.ts +47 -47
- package/src/browser/monaco-gotosymbol-quick-access.ts +53 -53
- package/src/browser/monaco-icon-registry.ts +49 -49
- package/src/browser/monaco-indexed-db.ts +130 -130
- package/src/browser/monaco-init.ts +134 -134
- package/src/browser/monaco-keybinding.ts +111 -111
- package/src/browser/monaco-keycode-map.ts +171 -171
- package/src/browser/monaco-languages.ts +177 -177
- package/src/browser/monaco-marker-collection.ts +83 -83
- package/src/browser/monaco-menu.ts +147 -147
- package/src/browser/monaco-mime-service.ts +71 -71
- package/src/browser/monaco-outline-contribution.ts +404 -404
- package/src/browser/monaco-outline-decorator.ts +66 -66
- package/src/browser/monaco-quick-access-registry.ts +112 -112
- package/src/browser/monaco-quick-input-service.ts +701 -701
- package/src/browser/monaco-resolved-keybinding.ts +162 -162
- package/src/browser/monaco-snippet-suggest-provider.ts +306 -306
- package/src/browser/monaco-standalone-theme-service.ts +51 -51
- package/src/browser/monaco-status-bar-contribution.ts +110 -110
- package/src/browser/monaco-text-model-service.ts +157 -157
- package/src/browser/monaco-theming-service.ts +204 -204
- package/src/browser/monaco-to-protocol-converter.ts +82 -82
- package/src/browser/monaco-undo-redo-handler.ts +64 -64
- package/src/browser/monaco-workspace.ts +416 -416
- package/src/browser/protocol-to-monaco-converter.ts +158 -158
- package/src/browser/simple-monaco-editor.ts +228 -216
- package/src/browser/style/index.css +266 -266
- package/src/browser/textmate/index.ts +20 -20
- package/src/browser/textmate/monaco-textmate-frontend-bindings.ts +90 -90
- package/src/browser/textmate/monaco-textmate-service.ts +187 -187
- package/src/browser/textmate/monaco-theme-registry.ts +176 -176
- package/src/browser/textmate/monaco-theme-types.ts +37 -37
- package/src/browser/textmate/textmate-contribution.ts +29 -29
- package/src/browser/textmate/textmate-registry.ts +129 -129
- package/src/browser/textmate/textmate-snippet-completion-provider.ts +73 -73
- package/src/browser/textmate/textmate-tokenizer.ts +84 -84
- package/src/browser/workspace-symbol-command.ts +196 -196
- package/src/package.spec.ts +28 -28
|
@@ -1,171 +1,171 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2017 TypeFox and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
/*---------------------------------------------------------------------------------------------
|
|
17
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
19
|
-
*--------------------------------------------------------------------------------------------*/
|
|
20
|
-
|
|
21
|
-
import * as browser from '@theia/core/lib/browser';
|
|
22
|
-
// This is exported as part of the public API, but we use it with private API's so we need to refer to the private version.
|
|
23
|
-
import { KeyCode } from '@theia/monaco-editor-core/esm/vs/base/common/keyCodes';
|
|
24
|
-
import * as MonacoPlatform from '@theia/monaco-editor-core/esm/vs/base/common/platform';
|
|
25
|
-
|
|
26
|
-
export const KEY_CODE_MAP: KeyCode[] = [];
|
|
27
|
-
(function (): void {
|
|
28
|
-
KEY_CODE_MAP[3] = KeyCode.PauseBreak; // VK_CANCEL 0x03 Control-break processing
|
|
29
|
-
KEY_CODE_MAP[8] = KeyCode.Backspace;
|
|
30
|
-
KEY_CODE_MAP[9] = KeyCode.Tab;
|
|
31
|
-
KEY_CODE_MAP[13] = KeyCode.Enter;
|
|
32
|
-
KEY_CODE_MAP[16] = KeyCode.Shift;
|
|
33
|
-
KEY_CODE_MAP[17] = KeyCode.Ctrl;
|
|
34
|
-
KEY_CODE_MAP[18] = KeyCode.Alt;
|
|
35
|
-
KEY_CODE_MAP[19] = KeyCode.PauseBreak;
|
|
36
|
-
KEY_CODE_MAP[20] = KeyCode.CapsLock;
|
|
37
|
-
KEY_CODE_MAP[27] = KeyCode.Escape;
|
|
38
|
-
KEY_CODE_MAP[32] = KeyCode.Space;
|
|
39
|
-
KEY_CODE_MAP[33] = KeyCode.PageUp;
|
|
40
|
-
KEY_CODE_MAP[34] = KeyCode.PageDown;
|
|
41
|
-
KEY_CODE_MAP[35] = KeyCode.End;
|
|
42
|
-
KEY_CODE_MAP[36] = KeyCode.Home;
|
|
43
|
-
KEY_CODE_MAP[37] = KeyCode.LeftArrow;
|
|
44
|
-
KEY_CODE_MAP[38] = KeyCode.UpArrow;
|
|
45
|
-
KEY_CODE_MAP[39] = KeyCode.RightArrow;
|
|
46
|
-
KEY_CODE_MAP[40] = KeyCode.DownArrow;
|
|
47
|
-
KEY_CODE_MAP[45] = KeyCode.Insert;
|
|
48
|
-
KEY_CODE_MAP[46] = KeyCode.Delete;
|
|
49
|
-
|
|
50
|
-
KEY_CODE_MAP[48] = KeyCode.Digit0;
|
|
51
|
-
KEY_CODE_MAP[49] = KeyCode.Digit1;
|
|
52
|
-
KEY_CODE_MAP[50] = KeyCode.Digit2;
|
|
53
|
-
KEY_CODE_MAP[51] = KeyCode.Digit3;
|
|
54
|
-
KEY_CODE_MAP[52] = KeyCode.Digit4;
|
|
55
|
-
KEY_CODE_MAP[53] = KeyCode.Digit5;
|
|
56
|
-
KEY_CODE_MAP[54] = KeyCode.Digit6;
|
|
57
|
-
KEY_CODE_MAP[55] = KeyCode.Digit7;
|
|
58
|
-
KEY_CODE_MAP[56] = KeyCode.Digit8;
|
|
59
|
-
KEY_CODE_MAP[57] = KeyCode.Digit9;
|
|
60
|
-
|
|
61
|
-
KEY_CODE_MAP[65] = KeyCode.KeyA;
|
|
62
|
-
KEY_CODE_MAP[66] = KeyCode.KeyB;
|
|
63
|
-
KEY_CODE_MAP[67] = KeyCode.KeyC;
|
|
64
|
-
KEY_CODE_MAP[68] = KeyCode.KeyD;
|
|
65
|
-
KEY_CODE_MAP[69] = KeyCode.KeyE;
|
|
66
|
-
KEY_CODE_MAP[70] = KeyCode.KeyF;
|
|
67
|
-
KEY_CODE_MAP[71] = KeyCode.KeyG;
|
|
68
|
-
KEY_CODE_MAP[72] = KeyCode.KeyH;
|
|
69
|
-
KEY_CODE_MAP[73] = KeyCode.KeyI;
|
|
70
|
-
KEY_CODE_MAP[74] = KeyCode.KeyJ;
|
|
71
|
-
KEY_CODE_MAP[75] = KeyCode.KeyK;
|
|
72
|
-
KEY_CODE_MAP[76] = KeyCode.KeyL;
|
|
73
|
-
KEY_CODE_MAP[77] = KeyCode.KeyM;
|
|
74
|
-
KEY_CODE_MAP[78] = KeyCode.KeyN;
|
|
75
|
-
KEY_CODE_MAP[79] = KeyCode.KeyO;
|
|
76
|
-
KEY_CODE_MAP[80] = KeyCode.KeyP;
|
|
77
|
-
KEY_CODE_MAP[81] = KeyCode.KeyQ;
|
|
78
|
-
KEY_CODE_MAP[82] = KeyCode.KeyR;
|
|
79
|
-
KEY_CODE_MAP[83] = KeyCode.KeyS;
|
|
80
|
-
KEY_CODE_MAP[84] = KeyCode.KeyT;
|
|
81
|
-
KEY_CODE_MAP[85] = KeyCode.KeyU;
|
|
82
|
-
KEY_CODE_MAP[86] = KeyCode.KeyV;
|
|
83
|
-
KEY_CODE_MAP[87] = KeyCode.KeyW;
|
|
84
|
-
KEY_CODE_MAP[88] = KeyCode.KeyX;
|
|
85
|
-
KEY_CODE_MAP[89] = KeyCode.KeyY;
|
|
86
|
-
KEY_CODE_MAP[90] = KeyCode.KeyZ;
|
|
87
|
-
|
|
88
|
-
KEY_CODE_MAP[93] = KeyCode.ContextMenu;
|
|
89
|
-
|
|
90
|
-
KEY_CODE_MAP[96] = KeyCode.Numpad0;
|
|
91
|
-
KEY_CODE_MAP[97] = KeyCode.Numpad1;
|
|
92
|
-
KEY_CODE_MAP[98] = KeyCode.Numpad2;
|
|
93
|
-
KEY_CODE_MAP[99] = KeyCode.Numpad3;
|
|
94
|
-
KEY_CODE_MAP[100] = KeyCode.Numpad4;
|
|
95
|
-
KEY_CODE_MAP[101] = KeyCode.Numpad5;
|
|
96
|
-
KEY_CODE_MAP[102] = KeyCode.Numpad6;
|
|
97
|
-
KEY_CODE_MAP[103] = KeyCode.Numpad7;
|
|
98
|
-
KEY_CODE_MAP[104] = KeyCode.Numpad8;
|
|
99
|
-
KEY_CODE_MAP[105] = KeyCode.Numpad9;
|
|
100
|
-
KEY_CODE_MAP[106] = KeyCode.NumpadMultiply;
|
|
101
|
-
KEY_CODE_MAP[107] = KeyCode.NumpadAdd;
|
|
102
|
-
KEY_CODE_MAP[108] = KeyCode.NUMPAD_SEPARATOR;
|
|
103
|
-
KEY_CODE_MAP[109] = KeyCode.NumpadSubtract;
|
|
104
|
-
KEY_CODE_MAP[110] = KeyCode.NumpadDecimal;
|
|
105
|
-
KEY_CODE_MAP[111] = KeyCode.NumpadDivide;
|
|
106
|
-
|
|
107
|
-
KEY_CODE_MAP[112] = KeyCode.F1;
|
|
108
|
-
KEY_CODE_MAP[113] = KeyCode.F2;
|
|
109
|
-
KEY_CODE_MAP[114] = KeyCode.F3;
|
|
110
|
-
KEY_CODE_MAP[115] = KeyCode.F4;
|
|
111
|
-
KEY_CODE_MAP[116] = KeyCode.F5;
|
|
112
|
-
KEY_CODE_MAP[117] = KeyCode.F6;
|
|
113
|
-
KEY_CODE_MAP[118] = KeyCode.F7;
|
|
114
|
-
KEY_CODE_MAP[119] = KeyCode.F8;
|
|
115
|
-
KEY_CODE_MAP[120] = KeyCode.F9;
|
|
116
|
-
KEY_CODE_MAP[121] = KeyCode.F10;
|
|
117
|
-
KEY_CODE_MAP[122] = KeyCode.F11;
|
|
118
|
-
KEY_CODE_MAP[123] = KeyCode.F12;
|
|
119
|
-
KEY_CODE_MAP[124] = KeyCode.F13;
|
|
120
|
-
KEY_CODE_MAP[125] = KeyCode.F14;
|
|
121
|
-
KEY_CODE_MAP[126] = KeyCode.F15;
|
|
122
|
-
KEY_CODE_MAP[127] = KeyCode.F16;
|
|
123
|
-
KEY_CODE_MAP[128] = KeyCode.F17;
|
|
124
|
-
KEY_CODE_MAP[129] = KeyCode.F18;
|
|
125
|
-
KEY_CODE_MAP[130] = KeyCode.F19;
|
|
126
|
-
|
|
127
|
-
KEY_CODE_MAP[144] = KeyCode.NumLock;
|
|
128
|
-
KEY_CODE_MAP[145] = KeyCode.ScrollLock;
|
|
129
|
-
|
|
130
|
-
KEY_CODE_MAP[186] = KeyCode.Semicolon;
|
|
131
|
-
KEY_CODE_MAP[187] = KeyCode.Equal;
|
|
132
|
-
KEY_CODE_MAP[188] = KeyCode.Comma;
|
|
133
|
-
KEY_CODE_MAP[189] = KeyCode.Minus;
|
|
134
|
-
KEY_CODE_MAP[190] = KeyCode.Period;
|
|
135
|
-
KEY_CODE_MAP[191] = KeyCode.Slash;
|
|
136
|
-
KEY_CODE_MAP[192] = KeyCode.Backquote;
|
|
137
|
-
KEY_CODE_MAP[193] = KeyCode.ABNT_C1;
|
|
138
|
-
KEY_CODE_MAP[194] = KeyCode.ABNT_C2;
|
|
139
|
-
KEY_CODE_MAP[219] = KeyCode.BracketLeft;
|
|
140
|
-
KEY_CODE_MAP[220] = KeyCode.Backslash;
|
|
141
|
-
KEY_CODE_MAP[221] = KeyCode.BracketRight;
|
|
142
|
-
KEY_CODE_MAP[222] = KeyCode.Quote;
|
|
143
|
-
KEY_CODE_MAP[223] = KeyCode.OEM_8;
|
|
144
|
-
|
|
145
|
-
KEY_CODE_MAP[226] = KeyCode.IntlBackslash;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html
|
|
149
|
-
* If an Input Method Editor is processing key input and the event is keydown, return 229.
|
|
150
|
-
*/
|
|
151
|
-
KEY_CODE_MAP[229] = KeyCode.KEY_IN_COMPOSITION;
|
|
152
|
-
|
|
153
|
-
if (browser.isIE) {
|
|
154
|
-
KEY_CODE_MAP[91] = KeyCode.Meta;
|
|
155
|
-
} else if (browser.isFirefox) {
|
|
156
|
-
KEY_CODE_MAP[59] = KeyCode.Semicolon;
|
|
157
|
-
KEY_CODE_MAP[107] = KeyCode.Equal;
|
|
158
|
-
KEY_CODE_MAP[109] = KeyCode.Minus;
|
|
159
|
-
if (MonacoPlatform.OS === MonacoPlatform.OperatingSystem.Macintosh) {
|
|
160
|
-
KEY_CODE_MAP[224] = KeyCode.Meta;
|
|
161
|
-
}
|
|
162
|
-
} else if (browser.isWebKit) {
|
|
163
|
-
KEY_CODE_MAP[91] = KeyCode.Meta;
|
|
164
|
-
if (MonacoPlatform.OS === MonacoPlatform.OperatingSystem.Macintosh) {
|
|
165
|
-
// the two meta keys in the Mac have different key codes (91 and 93)
|
|
166
|
-
KEY_CODE_MAP[93] = KeyCode.Meta;
|
|
167
|
-
} else {
|
|
168
|
-
KEY_CODE_MAP[92] = KeyCode.Meta;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
})();
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2017 TypeFox and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
/*---------------------------------------------------------------------------------------------
|
|
17
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
18
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
19
|
+
*--------------------------------------------------------------------------------------------*/
|
|
20
|
+
|
|
21
|
+
import * as browser from '@theia/core/lib/browser';
|
|
22
|
+
// This is exported as part of the public API, but we use it with private API's so we need to refer to the private version.
|
|
23
|
+
import { KeyCode } from '@theia/monaco-editor-core/esm/vs/base/common/keyCodes';
|
|
24
|
+
import * as MonacoPlatform from '@theia/monaco-editor-core/esm/vs/base/common/platform';
|
|
25
|
+
|
|
26
|
+
export const KEY_CODE_MAP: KeyCode[] = [];
|
|
27
|
+
(function (): void {
|
|
28
|
+
KEY_CODE_MAP[3] = KeyCode.PauseBreak; // VK_CANCEL 0x03 Control-break processing
|
|
29
|
+
KEY_CODE_MAP[8] = KeyCode.Backspace;
|
|
30
|
+
KEY_CODE_MAP[9] = KeyCode.Tab;
|
|
31
|
+
KEY_CODE_MAP[13] = KeyCode.Enter;
|
|
32
|
+
KEY_CODE_MAP[16] = KeyCode.Shift;
|
|
33
|
+
KEY_CODE_MAP[17] = KeyCode.Ctrl;
|
|
34
|
+
KEY_CODE_MAP[18] = KeyCode.Alt;
|
|
35
|
+
KEY_CODE_MAP[19] = KeyCode.PauseBreak;
|
|
36
|
+
KEY_CODE_MAP[20] = KeyCode.CapsLock;
|
|
37
|
+
KEY_CODE_MAP[27] = KeyCode.Escape;
|
|
38
|
+
KEY_CODE_MAP[32] = KeyCode.Space;
|
|
39
|
+
KEY_CODE_MAP[33] = KeyCode.PageUp;
|
|
40
|
+
KEY_CODE_MAP[34] = KeyCode.PageDown;
|
|
41
|
+
KEY_CODE_MAP[35] = KeyCode.End;
|
|
42
|
+
KEY_CODE_MAP[36] = KeyCode.Home;
|
|
43
|
+
KEY_CODE_MAP[37] = KeyCode.LeftArrow;
|
|
44
|
+
KEY_CODE_MAP[38] = KeyCode.UpArrow;
|
|
45
|
+
KEY_CODE_MAP[39] = KeyCode.RightArrow;
|
|
46
|
+
KEY_CODE_MAP[40] = KeyCode.DownArrow;
|
|
47
|
+
KEY_CODE_MAP[45] = KeyCode.Insert;
|
|
48
|
+
KEY_CODE_MAP[46] = KeyCode.Delete;
|
|
49
|
+
|
|
50
|
+
KEY_CODE_MAP[48] = KeyCode.Digit0;
|
|
51
|
+
KEY_CODE_MAP[49] = KeyCode.Digit1;
|
|
52
|
+
KEY_CODE_MAP[50] = KeyCode.Digit2;
|
|
53
|
+
KEY_CODE_MAP[51] = KeyCode.Digit3;
|
|
54
|
+
KEY_CODE_MAP[52] = KeyCode.Digit4;
|
|
55
|
+
KEY_CODE_MAP[53] = KeyCode.Digit5;
|
|
56
|
+
KEY_CODE_MAP[54] = KeyCode.Digit6;
|
|
57
|
+
KEY_CODE_MAP[55] = KeyCode.Digit7;
|
|
58
|
+
KEY_CODE_MAP[56] = KeyCode.Digit8;
|
|
59
|
+
KEY_CODE_MAP[57] = KeyCode.Digit9;
|
|
60
|
+
|
|
61
|
+
KEY_CODE_MAP[65] = KeyCode.KeyA;
|
|
62
|
+
KEY_CODE_MAP[66] = KeyCode.KeyB;
|
|
63
|
+
KEY_CODE_MAP[67] = KeyCode.KeyC;
|
|
64
|
+
KEY_CODE_MAP[68] = KeyCode.KeyD;
|
|
65
|
+
KEY_CODE_MAP[69] = KeyCode.KeyE;
|
|
66
|
+
KEY_CODE_MAP[70] = KeyCode.KeyF;
|
|
67
|
+
KEY_CODE_MAP[71] = KeyCode.KeyG;
|
|
68
|
+
KEY_CODE_MAP[72] = KeyCode.KeyH;
|
|
69
|
+
KEY_CODE_MAP[73] = KeyCode.KeyI;
|
|
70
|
+
KEY_CODE_MAP[74] = KeyCode.KeyJ;
|
|
71
|
+
KEY_CODE_MAP[75] = KeyCode.KeyK;
|
|
72
|
+
KEY_CODE_MAP[76] = KeyCode.KeyL;
|
|
73
|
+
KEY_CODE_MAP[77] = KeyCode.KeyM;
|
|
74
|
+
KEY_CODE_MAP[78] = KeyCode.KeyN;
|
|
75
|
+
KEY_CODE_MAP[79] = KeyCode.KeyO;
|
|
76
|
+
KEY_CODE_MAP[80] = KeyCode.KeyP;
|
|
77
|
+
KEY_CODE_MAP[81] = KeyCode.KeyQ;
|
|
78
|
+
KEY_CODE_MAP[82] = KeyCode.KeyR;
|
|
79
|
+
KEY_CODE_MAP[83] = KeyCode.KeyS;
|
|
80
|
+
KEY_CODE_MAP[84] = KeyCode.KeyT;
|
|
81
|
+
KEY_CODE_MAP[85] = KeyCode.KeyU;
|
|
82
|
+
KEY_CODE_MAP[86] = KeyCode.KeyV;
|
|
83
|
+
KEY_CODE_MAP[87] = KeyCode.KeyW;
|
|
84
|
+
KEY_CODE_MAP[88] = KeyCode.KeyX;
|
|
85
|
+
KEY_CODE_MAP[89] = KeyCode.KeyY;
|
|
86
|
+
KEY_CODE_MAP[90] = KeyCode.KeyZ;
|
|
87
|
+
|
|
88
|
+
KEY_CODE_MAP[93] = KeyCode.ContextMenu;
|
|
89
|
+
|
|
90
|
+
KEY_CODE_MAP[96] = KeyCode.Numpad0;
|
|
91
|
+
KEY_CODE_MAP[97] = KeyCode.Numpad1;
|
|
92
|
+
KEY_CODE_MAP[98] = KeyCode.Numpad2;
|
|
93
|
+
KEY_CODE_MAP[99] = KeyCode.Numpad3;
|
|
94
|
+
KEY_CODE_MAP[100] = KeyCode.Numpad4;
|
|
95
|
+
KEY_CODE_MAP[101] = KeyCode.Numpad5;
|
|
96
|
+
KEY_CODE_MAP[102] = KeyCode.Numpad6;
|
|
97
|
+
KEY_CODE_MAP[103] = KeyCode.Numpad7;
|
|
98
|
+
KEY_CODE_MAP[104] = KeyCode.Numpad8;
|
|
99
|
+
KEY_CODE_MAP[105] = KeyCode.Numpad9;
|
|
100
|
+
KEY_CODE_MAP[106] = KeyCode.NumpadMultiply;
|
|
101
|
+
KEY_CODE_MAP[107] = KeyCode.NumpadAdd;
|
|
102
|
+
KEY_CODE_MAP[108] = KeyCode.NUMPAD_SEPARATOR;
|
|
103
|
+
KEY_CODE_MAP[109] = KeyCode.NumpadSubtract;
|
|
104
|
+
KEY_CODE_MAP[110] = KeyCode.NumpadDecimal;
|
|
105
|
+
KEY_CODE_MAP[111] = KeyCode.NumpadDivide;
|
|
106
|
+
|
|
107
|
+
KEY_CODE_MAP[112] = KeyCode.F1;
|
|
108
|
+
KEY_CODE_MAP[113] = KeyCode.F2;
|
|
109
|
+
KEY_CODE_MAP[114] = KeyCode.F3;
|
|
110
|
+
KEY_CODE_MAP[115] = KeyCode.F4;
|
|
111
|
+
KEY_CODE_MAP[116] = KeyCode.F5;
|
|
112
|
+
KEY_CODE_MAP[117] = KeyCode.F6;
|
|
113
|
+
KEY_CODE_MAP[118] = KeyCode.F7;
|
|
114
|
+
KEY_CODE_MAP[119] = KeyCode.F8;
|
|
115
|
+
KEY_CODE_MAP[120] = KeyCode.F9;
|
|
116
|
+
KEY_CODE_MAP[121] = KeyCode.F10;
|
|
117
|
+
KEY_CODE_MAP[122] = KeyCode.F11;
|
|
118
|
+
KEY_CODE_MAP[123] = KeyCode.F12;
|
|
119
|
+
KEY_CODE_MAP[124] = KeyCode.F13;
|
|
120
|
+
KEY_CODE_MAP[125] = KeyCode.F14;
|
|
121
|
+
KEY_CODE_MAP[126] = KeyCode.F15;
|
|
122
|
+
KEY_CODE_MAP[127] = KeyCode.F16;
|
|
123
|
+
KEY_CODE_MAP[128] = KeyCode.F17;
|
|
124
|
+
KEY_CODE_MAP[129] = KeyCode.F18;
|
|
125
|
+
KEY_CODE_MAP[130] = KeyCode.F19;
|
|
126
|
+
|
|
127
|
+
KEY_CODE_MAP[144] = KeyCode.NumLock;
|
|
128
|
+
KEY_CODE_MAP[145] = KeyCode.ScrollLock;
|
|
129
|
+
|
|
130
|
+
KEY_CODE_MAP[186] = KeyCode.Semicolon;
|
|
131
|
+
KEY_CODE_MAP[187] = KeyCode.Equal;
|
|
132
|
+
KEY_CODE_MAP[188] = KeyCode.Comma;
|
|
133
|
+
KEY_CODE_MAP[189] = KeyCode.Minus;
|
|
134
|
+
KEY_CODE_MAP[190] = KeyCode.Period;
|
|
135
|
+
KEY_CODE_MAP[191] = KeyCode.Slash;
|
|
136
|
+
KEY_CODE_MAP[192] = KeyCode.Backquote;
|
|
137
|
+
KEY_CODE_MAP[193] = KeyCode.ABNT_C1;
|
|
138
|
+
KEY_CODE_MAP[194] = KeyCode.ABNT_C2;
|
|
139
|
+
KEY_CODE_MAP[219] = KeyCode.BracketLeft;
|
|
140
|
+
KEY_CODE_MAP[220] = KeyCode.Backslash;
|
|
141
|
+
KEY_CODE_MAP[221] = KeyCode.BracketRight;
|
|
142
|
+
KEY_CODE_MAP[222] = KeyCode.Quote;
|
|
143
|
+
KEY_CODE_MAP[223] = KeyCode.OEM_8;
|
|
144
|
+
|
|
145
|
+
KEY_CODE_MAP[226] = KeyCode.IntlBackslash;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html
|
|
149
|
+
* If an Input Method Editor is processing key input and the event is keydown, return 229.
|
|
150
|
+
*/
|
|
151
|
+
KEY_CODE_MAP[229] = KeyCode.KEY_IN_COMPOSITION;
|
|
152
|
+
|
|
153
|
+
if (browser.isIE) {
|
|
154
|
+
KEY_CODE_MAP[91] = KeyCode.Meta;
|
|
155
|
+
} else if (browser.isFirefox) {
|
|
156
|
+
KEY_CODE_MAP[59] = KeyCode.Semicolon;
|
|
157
|
+
KEY_CODE_MAP[107] = KeyCode.Equal;
|
|
158
|
+
KEY_CODE_MAP[109] = KeyCode.Minus;
|
|
159
|
+
if (MonacoPlatform.OS === MonacoPlatform.OperatingSystem.Macintosh) {
|
|
160
|
+
KEY_CODE_MAP[224] = KeyCode.Meta;
|
|
161
|
+
}
|
|
162
|
+
} else if (browser.isWebKit) {
|
|
163
|
+
KEY_CODE_MAP[91] = KeyCode.Meta;
|
|
164
|
+
if (MonacoPlatform.OS === MonacoPlatform.OperatingSystem.Macintosh) {
|
|
165
|
+
// the two meta keys in the Mac have different key codes (91 and 93)
|
|
166
|
+
KEY_CODE_MAP[93] = KeyCode.Meta;
|
|
167
|
+
} else {
|
|
168
|
+
KEY_CODE_MAP[92] = KeyCode.Meta;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
})();
|