提交 da5a85f5 编写于 作者: R rebornix

correct keycode enum

上级 4c642de8
......@@ -128,6 +128,10 @@ let KEY_CODE_MAP: { [keyCode: number]: KeyCode } = {};
KEY_CODE_MAP[226] = KeyCode.OEM_102;
/**
* https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html
* If an Input Method Editor is processing key input and the event is keydown, return 229.
*/
KEY_CODE_MAP[229] = KeyCode.KEY_IN_COMPOSITION;
if (browser.isIE) {
......
......@@ -186,10 +186,9 @@ export const enum KeyCode {
NUMPAD_DIVIDE = 108, // VK_DIVIDE, 0x6F,
/**
* https://lists.w3.org/Archives/Public/www-dom/2010JulSep/att-0182/keyCode-spec.html
* If an Input Method Editor is processing key input and the event is keydown, return 229.
* Cover all key codes when IME is processing input.
*/
KEY_IN_COMPOSITION = 229,
KEY_IN_COMPOSITION = 109,
/**
* Placed last to cover the length of the enum.
......
......@@ -209,6 +209,10 @@ export enum KeyCode {
NUMPAD_SUBTRACT = 106,
NUMPAD_DECIMAL = 107,
NUMPAD_DIVIDE = 108,
/**
* Cover all key codes when IME is processing input.
*/
KEY_IN_COMPOSITION = 109,
/**
* Placed last to cover the length of the enum.
* Please do not depend on this value!
......
......@@ -134,6 +134,7 @@ suite('KeyCode', () => {
assertKeyCode(StandaloneKeyCode.NUMPAD_SUBTRACT, RuntimeKeyCode.NUMPAD_SUBTRACT);
assertKeyCode(StandaloneKeyCode.NUMPAD_DECIMAL, RuntimeKeyCode.NUMPAD_DECIMAL);
assertKeyCode(StandaloneKeyCode.NUMPAD_DIVIDE, RuntimeKeyCode.NUMPAD_DIVIDE);
assertKeyCode(StandaloneKeyCode.KEY_IN_COMPOSITION, RuntimeKeyCode.KEY_IN_COMPOSITION);
assertKeyCode(StandaloneKeyCode.MAX_VALUE, RuntimeKeyCode.MAX_VALUE);
});
});
......@@ -348,11 +348,15 @@ declare module monaco {
NUMPAD_SUBTRACT = 106,
NUMPAD_DECIMAL = 107,
NUMPAD_DIVIDE = 108,
/**
* Cover all key codes when IME is processing input.
*/
KEY_IN_COMPOSITION = 109,
/**
* Placed last to cover the length of the enum.
* Please do not depend on this value!
*/
MAX_VALUE = 109,
MAX_VALUE = 110,
}
export class KeyMod {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册