

var KeyCode;
(function(KeyCode) {
    KeyCode[KeyCode["DependsOnKbLayout"] = -1] = "DependsOnKbLayout";
    KeyCode[KeyCode["Unknown"] = 0] = "Unknown";
    KeyCode[KeyCode["Backspace"] = 1] = "Backspace";
    KeyCode[KeyCode["Tab"] = 2] = "Tab";
    KeyCode[KeyCode["Enter"] = 3] = "Enter";
    KeyCode[KeyCode["Shift"] = 4] = "Shift";
    KeyCode[KeyCode["Ctrl"] = 5] = "Ctrl";
    KeyCode[KeyCode["Alt"] = 6] = "Alt";
    KeyCode[KeyCode["PauseBreak"] = 7] = "PauseBreak";
    KeyCode[KeyCode["CapsLock"] = 8] = "CapsLock";
    KeyCode[KeyCode["Escape"] = 9] = "Escape";
    KeyCode[KeyCode["Space"] = 10] = "Space";
    KeyCode[KeyCode["PageUp"] = 11] = "PageUp";
    KeyCode[KeyCode["PageDown"] = 12] = "PageDown";
    KeyCode[KeyCode["End"] = 13] = "End";
    KeyCode[KeyCode["Home"] = 14] = "Home";
    KeyCode[KeyCode["LeftArrow"] = 15] = "LeftArrow";
    KeyCode[KeyCode["UpArrow"] = 16] = "UpArrow";
    KeyCode[KeyCode["RightArrow"] = 17] = "RightArrow";
    KeyCode[KeyCode["DownArrow"] = 18] = "DownArrow";
    KeyCode[KeyCode["Insert"] = 19] = "Insert";
    KeyCode[KeyCode["Delete"] = 20] = "Delete";
    KeyCode[KeyCode["Digit0"] = 21] = "Digit0";
    KeyCode[KeyCode["Digit1"] = 22] = "Digit1";
    KeyCode[KeyCode["Digit2"] = 23] = "Digit2";
    KeyCode[KeyCode["Digit3"] = 24] = "Digit3";
    KeyCode[KeyCode["Digit4"] = 25] = "Digit4";
    KeyCode[KeyCode["Digit5"] = 26] = "Digit5";
    KeyCode[KeyCode["Digit6"] = 27] = "Digit6";
    KeyCode[KeyCode["Digit7"] = 28] = "Digit7";
    KeyCode[KeyCode["Digit8"] = 29] = "Digit8";
    KeyCode[KeyCode["Digit9"] = 30] = "Digit9";
    KeyCode[KeyCode["KeyA"] = 31] = "KeyA";
    KeyCode[KeyCode["KeyB"] = 32] = "KeyB";
    KeyCode[KeyCode["KeyC"] = 33] = "KeyC";
    KeyCode[KeyCode["KeyD"] = 34] = "KeyD";
    KeyCode[KeyCode["KeyE"] = 35] = "KeyE";
    KeyCode[KeyCode["KeyF"] = 36] = "KeyF";
    KeyCode[KeyCode["KeyG"] = 37] = "KeyG";
    KeyCode[KeyCode["KeyH"] = 38] = "KeyH";
    KeyCode[KeyCode["KeyI"] = 39] = "KeyI";
    KeyCode[KeyCode["KeyJ"] = 40] = "KeyJ";
    KeyCode[KeyCode["KeyK"] = 41] = "KeyK";
    KeyCode[KeyCode["KeyL"] = 42] = "KeyL";
    KeyCode[KeyCode["KeyM"] = 43] = "KeyM";
    KeyCode[KeyCode["KeyN"] = 44] = "KeyN";
    KeyCode[KeyCode["KeyO"] = 45] = "KeyO";
    KeyCode[KeyCode["KeyP"] = 46] = "KeyP";
    KeyCode[KeyCode["KeyQ"] = 47] = "KeyQ";
    KeyCode[KeyCode["KeyR"] = 48] = "KeyR";
    KeyCode[KeyCode["KeyS"] = 49] = "KeyS";
    KeyCode[KeyCode["KeyT"] = 50] = "KeyT";
    KeyCode[KeyCode["KeyU"] = 51] = "KeyU";
    KeyCode[KeyCode["KeyV"] = 52] = "KeyV";
    KeyCode[KeyCode["KeyW"] = 53] = "KeyW";
    KeyCode[KeyCode["KeyX"] = 54] = "KeyX";
    KeyCode[KeyCode["KeyY"] = 55] = "KeyY";
    KeyCode[KeyCode["KeyZ"] = 56] = "KeyZ";
    KeyCode[KeyCode["Meta"] = 57] = "Meta";
    KeyCode[KeyCode["ContextMenu"] = 58] = "ContextMenu";
    KeyCode[KeyCode["F1"] = 59] = "F1";
    KeyCode[KeyCode["F2"] = 60] = "F2";
    KeyCode[KeyCode["F3"] = 61] = "F3";
    KeyCode[KeyCode["F4"] = 62] = "F4";
    KeyCode[KeyCode["F5"] = 63] = "F5";
    KeyCode[KeyCode["F6"] = 64] = "F6";
    KeyCode[KeyCode["F7"] = 65] = "F7";
    KeyCode[KeyCode["F8"] = 66] = "F8";
    KeyCode[KeyCode["F9"] = 67] = "F9";
    KeyCode[KeyCode["F10"] = 68] = "F10";
    KeyCode[KeyCode["F11"] = 69] = "F11";
    KeyCode[KeyCode["F12"] = 70] = "F12";
    KeyCode[KeyCode["F13"] = 71] = "F13";
    KeyCode[KeyCode["F14"] = 72] = "F14";
    KeyCode[KeyCode["F15"] = 73] = "F15";
    KeyCode[KeyCode["F16"] = 74] = "F16";
    KeyCode[KeyCode["F17"] = 75] = "F17";
    KeyCode[KeyCode["F18"] = 76] = "F18";
    KeyCode[KeyCode["F19"] = 77] = "F19";
    KeyCode[KeyCode["F20"] = 78] = "F20";
    KeyCode[KeyCode["F21"] = 79] = "F21";
    KeyCode[KeyCode["F22"] = 80] = "F22";
    KeyCode[KeyCode["F23"] = 81] = "F23";
    KeyCode[KeyCode["F24"] = 82] = "F24";
    KeyCode[KeyCode["NumLock"] = 83] = "NumLock";
    KeyCode[KeyCode["ScrollLock"] = 84] = "ScrollLock";
    KeyCode[KeyCode["Semicolon"] = 85] = "Semicolon";
    KeyCode[KeyCode["Equal"] = 86] = "Equal";
    KeyCode[KeyCode["Comma"] = 87] = "Comma";
    KeyCode[KeyCode["Minus"] = 88] = "Minus";
    KeyCode[KeyCode["Period"] = 89] = "Period";
    KeyCode[KeyCode["Slash"] = 90] = "Slash";
    KeyCode[KeyCode["Backquote"] = 91] = "Backquote";
    KeyCode[KeyCode["BracketLeft"] = 92] = "BracketLeft";
    KeyCode[KeyCode["Backslash"] = 93] = "Backslash";
    KeyCode[KeyCode["BracketRight"] = 94] = "BracketRight";
    KeyCode[KeyCode["Quote"] = 95] = "Quote";
    KeyCode[KeyCode["OEM_8"] = 96] = "OEM_8";
    KeyCode[KeyCode["IntlBackslash"] = 97] = "IntlBackslash";
    KeyCode[KeyCode["Numpad0"] = 98] = "Numpad0";
    KeyCode[KeyCode["Numpad1"] = 99] = "Numpad1";
    KeyCode[KeyCode["Numpad2"] = 100] = "Numpad2";
    KeyCode[KeyCode["Numpad3"] = 101] = "Numpad3";
    KeyCode[KeyCode["Numpad4"] = 102] = "Numpad4";
    KeyCode[KeyCode["Numpad5"] = 103] = "Numpad5";
    KeyCode[KeyCode["Numpad6"] = 104] = "Numpad6";
    KeyCode[KeyCode["Numpad7"] = 105] = "Numpad7";
    KeyCode[KeyCode["Numpad8"] = 106] = "Numpad8";
    KeyCode[KeyCode["Numpad9"] = 107] = "Numpad9";
    KeyCode[KeyCode["NumpadMultiply"] = 108] = "NumpadMultiply";
    KeyCode[KeyCode["NumpadAdd"] = 109] = "NumpadAdd";
    KeyCode[KeyCode["NUMPAD_SEPARATOR"] = 110] = "NUMPAD_SEPARATOR";
    KeyCode[KeyCode["NumpadSubtract"] = 111] = "NumpadSubtract";
    KeyCode[KeyCode["NumpadDecimal"] = 112] = "NumpadDecimal";
    KeyCode[KeyCode["NumpadDivide"] = 113] = "NumpadDivide";
    KeyCode[KeyCode["KEY_IN_COMPOSITION"] = 114] = "KEY_IN_COMPOSITION";
    KeyCode[KeyCode["ABNT_C1"] = 115] = "ABNT_C1";
    KeyCode[KeyCode["ABNT_C2"] = 116] = "ABNT_C2";
    KeyCode[KeyCode["AudioVolumeMute"] = 117] = "AudioVolumeMute";
    KeyCode[KeyCode["AudioVolumeUp"] = 118] = "AudioVolumeUp";
    KeyCode[KeyCode["AudioVolumeDown"] = 119] = "AudioVolumeDown";
    KeyCode[KeyCode["BrowserSearch"] = 120] = "BrowserSearch";
    KeyCode[KeyCode["BrowserHome"] = 121] = "BrowserHome";
    KeyCode[KeyCode["BrowserBack"] = 122] = "BrowserBack";
    KeyCode[KeyCode["BrowserForward"] = 123] = "BrowserForward";
    KeyCode[KeyCode["MediaTrackNext"] = 124] = "MediaTrackNext";
    KeyCode[KeyCode["MediaTrackPrevious"] = 125] = "MediaTrackPrevious";
    KeyCode[KeyCode["MediaStop"] = 126] = "MediaStop";
    KeyCode[KeyCode["MediaPlayPause"] = 127] = "MediaPlayPause";
    KeyCode[KeyCode["LaunchMediaPlayer"] = 128] = "LaunchMediaPlayer";
    KeyCode[KeyCode["LaunchMail"] = 129] = "LaunchMail";
    KeyCode[KeyCode["LaunchApp2"] = 130] = "LaunchApp2";
    KeyCode[KeyCode["Clear"] = 131] = "Clear";
    KeyCode[KeyCode["MAX_VALUE"] = 132] = "MAX_VALUE";
})(KeyCode || (KeyCode = {}));
var ScanCode;
(function(ScanCode) {
    ScanCode[ScanCode["DependsOnKbLayout"] = -1] = "DependsOnKbLayout";
    ScanCode[ScanCode["None"] = 0] = "None";
    ScanCode[ScanCode["Hyper"] = 1] = "Hyper";
    ScanCode[ScanCode["Super"] = 2] = "Super";
    ScanCode[ScanCode["Fn"] = 3] = "Fn";
    ScanCode[ScanCode["FnLock"] = 4] = "FnLock";
    ScanCode[ScanCode["Suspend"] = 5] = "Suspend";
    ScanCode[ScanCode["Resume"] = 6] = "Resume";
    ScanCode[ScanCode["Turbo"] = 7] = "Turbo";
    ScanCode[ScanCode["Sleep"] = 8] = "Sleep";
    ScanCode[ScanCode["WakeUp"] = 9] = "WakeUp";
    ScanCode[ScanCode["KeyA"] = 10] = "KeyA";
    ScanCode[ScanCode["KeyB"] = 11] = "KeyB";
    ScanCode[ScanCode["KeyC"] = 12] = "KeyC";
    ScanCode[ScanCode["KeyD"] = 13] = "KeyD";
    ScanCode[ScanCode["KeyE"] = 14] = "KeyE";
    ScanCode[ScanCode["KeyF"] = 15] = "KeyF";
    ScanCode[ScanCode["KeyG"] = 16] = "KeyG";
    ScanCode[ScanCode["KeyH"] = 17] = "KeyH";
    ScanCode[ScanCode["KeyI"] = 18] = "KeyI";
    ScanCode[ScanCode["KeyJ"] = 19] = "KeyJ";
    ScanCode[ScanCode["KeyK"] = 20] = "KeyK";
    ScanCode[ScanCode["KeyL"] = 21] = "KeyL";
    ScanCode[ScanCode["KeyM"] = 22] = "KeyM";
    ScanCode[ScanCode["KeyN"] = 23] = "KeyN";
    ScanCode[ScanCode["KeyO"] = 24] = "KeyO";
    ScanCode[ScanCode["KeyP"] = 25] = "KeyP";
    ScanCode[ScanCode["KeyQ"] = 26] = "KeyQ";
    ScanCode[ScanCode["KeyR"] = 27] = "KeyR";
    ScanCode[ScanCode["KeyS"] = 28] = "KeyS";
    ScanCode[ScanCode["KeyT"] = 29] = "KeyT";
    ScanCode[ScanCode["KeyU"] = 30] = "KeyU";
    ScanCode[ScanCode["KeyV"] = 31] = "KeyV";
    ScanCode[ScanCode["KeyW"] = 32] = "KeyW";
    ScanCode[ScanCode["KeyX"] = 33] = "KeyX";
    ScanCode[ScanCode["KeyY"] = 34] = "KeyY";
    ScanCode[ScanCode["KeyZ"] = 35] = "KeyZ";
    ScanCode[ScanCode["Digit1"] = 36] = "Digit1";
    ScanCode[ScanCode["Digit2"] = 37] = "Digit2";
    ScanCode[ScanCode["Digit3"] = 38] = "Digit3";
    ScanCode[ScanCode["Digit4"] = 39] = "Digit4";
    ScanCode[ScanCode["Digit5"] = 40] = "Digit5";
    ScanCode[ScanCode["Digit6"] = 41] = "Digit6";
    ScanCode[ScanCode["Digit7"] = 42] = "Digit7";
    ScanCode[ScanCode["Digit8"] = 43] = "Digit8";
    ScanCode[ScanCode["Digit9"] = 44] = "Digit9";
    ScanCode[ScanCode["Digit0"] = 45] = "Digit0";
    ScanCode[ScanCode["Enter"] = 46] = "Enter";
    ScanCode[ScanCode["Escape"] = 47] = "Escape";
    ScanCode[ScanCode["Backspace"] = 48] = "Backspace";
    ScanCode[ScanCode["Tab"] = 49] = "Tab";
    ScanCode[ScanCode["Space"] = 50] = "Space";
    ScanCode[ScanCode["Minus"] = 51] = "Minus";
    ScanCode[ScanCode["Equal"] = 52] = "Equal";
    ScanCode[ScanCode["BracketLeft"] = 53] = "BracketLeft";
    ScanCode[ScanCode["BracketRight"] = 54] = "BracketRight";
    ScanCode[ScanCode["Backslash"] = 55] = "Backslash";
    ScanCode[ScanCode["IntlHash"] = 56] = "IntlHash";
    ScanCode[ScanCode["Semicolon"] = 57] = "Semicolon";
    ScanCode[ScanCode["Quote"] = 58] = "Quote";
    ScanCode[ScanCode["Backquote"] = 59] = "Backquote";
    ScanCode[ScanCode["Comma"] = 60] = "Comma";
    ScanCode[ScanCode["Period"] = 61] = "Period";
    ScanCode[ScanCode["Slash"] = 62] = "Slash";
    ScanCode[ScanCode["CapsLock"] = 63] = "CapsLock";
    ScanCode[ScanCode["F1"] = 64] = "F1";
    ScanCode[ScanCode["F2"] = 65] = "F2";
    ScanCode[ScanCode["F3"] = 66] = "F3";
    ScanCode[ScanCode["F4"] = 67] = "F4";
    ScanCode[ScanCode["F5"] = 68] = "F5";
    ScanCode[ScanCode["F6"] = 69] = "F6";
    ScanCode[ScanCode["F7"] = 70] = "F7";
    ScanCode[ScanCode["F8"] = 71] = "F8";
    ScanCode[ScanCode["F9"] = 72] = "F9";
    ScanCode[ScanCode["F10"] = 73] = "F10";
    ScanCode[ScanCode["F11"] = 74] = "F11";
    ScanCode[ScanCode["F12"] = 75] = "F12";
    ScanCode[ScanCode["PrintScreen"] = 76] = "PrintScreen";
    ScanCode[ScanCode["ScrollLock"] = 77] = "ScrollLock";
    ScanCode[ScanCode["Pause"] = 78] = "Pause";
    ScanCode[ScanCode["Insert"] = 79] = "Insert";
    ScanCode[ScanCode["Home"] = 80] = "Home";
    ScanCode[ScanCode["PageUp"] = 81] = "PageUp";
    ScanCode[ScanCode["Delete"] = 82] = "Delete";
    ScanCode[ScanCode["End"] = 83] = "End";
    ScanCode[ScanCode["PageDown"] = 84] = "PageDown";
    ScanCode[ScanCode["ArrowRight"] = 85] = "ArrowRight";
    ScanCode[ScanCode["ArrowLeft"] = 86] = "ArrowLeft";
    ScanCode[ScanCode["ArrowDown"] = 87] = "ArrowDown";
    ScanCode[ScanCode["ArrowUp"] = 88] = "ArrowUp";
    ScanCode[ScanCode["NumLock"] = 89] = "NumLock";
    ScanCode[ScanCode["NumpadDivide"] = 90] = "NumpadDivide";
    ScanCode[ScanCode["NumpadMultiply"] = 91] = "NumpadMultiply";
    ScanCode[ScanCode["NumpadSubtract"] = 92] = "NumpadSubtract";
    ScanCode[ScanCode["NumpadAdd"] = 93] = "NumpadAdd";
    ScanCode[ScanCode["NumpadEnter"] = 94] = "NumpadEnter";
    ScanCode[ScanCode["Numpad1"] = 95] = "Numpad1";
    ScanCode[ScanCode["Numpad2"] = 96] = "Numpad2";
    ScanCode[ScanCode["Numpad3"] = 97] = "Numpad3";
    ScanCode[ScanCode["Numpad4"] = 98] = "Numpad4";
    ScanCode[ScanCode["Numpad5"] = 99] = "Numpad5";
    ScanCode[ScanCode["Numpad6"] = 100] = "Numpad6";
    ScanCode[ScanCode["Numpad7"] = 101] = "Numpad7";
    ScanCode[ScanCode["Numpad8"] = 102] = "Numpad8";
    ScanCode[ScanCode["Numpad9"] = 103] = "Numpad9";
    ScanCode[ScanCode["Numpad0"] = 104] = "Numpad0";
    ScanCode[ScanCode["NumpadDecimal"] = 105] = "NumpadDecimal";
    ScanCode[ScanCode["IntlBackslash"] = 106] = "IntlBackslash";
    ScanCode[ScanCode["ContextMenu"] = 107] = "ContextMenu";
    ScanCode[ScanCode["Power"] = 108] = "Power";
    ScanCode[ScanCode["NumpadEqual"] = 109] = "NumpadEqual";
    ScanCode[ScanCode["F13"] = 110] = "F13";
    ScanCode[ScanCode["F14"] = 111] = "F14";
    ScanCode[ScanCode["F15"] = 112] = "F15";
    ScanCode[ScanCode["F16"] = 113] = "F16";
    ScanCode[ScanCode["F17"] = 114] = "F17";
    ScanCode[ScanCode["F18"] = 115] = "F18";
    ScanCode[ScanCode["F19"] = 116] = "F19";
    ScanCode[ScanCode["F20"] = 117] = "F20";
    ScanCode[ScanCode["F21"] = 118] = "F21";
    ScanCode[ScanCode["F22"] = 119] = "F22";
    ScanCode[ScanCode["F23"] = 120] = "F23";
    ScanCode[ScanCode["F24"] = 121] = "F24";
    ScanCode[ScanCode["Open"] = 122] = "Open";
    ScanCode[ScanCode["Help"] = 123] = "Help";
    ScanCode[ScanCode["Select"] = 124] = "Select";
    ScanCode[ScanCode["Again"] = 125] = "Again";
    ScanCode[ScanCode["Undo"] = 126] = "Undo";
    ScanCode[ScanCode["Cut"] = 127] = "Cut";
    ScanCode[ScanCode["Copy"] = 128] = "Copy";
    ScanCode[ScanCode["Paste"] = 129] = "Paste";
    ScanCode[ScanCode["Find"] = 130] = "Find";
    ScanCode[ScanCode["AudioVolumeMute"] = 131] = "AudioVolumeMute";
    ScanCode[ScanCode["AudioVolumeUp"] = 132] = "AudioVolumeUp";
    ScanCode[ScanCode["AudioVolumeDown"] = 133] = "AudioVolumeDown";
    ScanCode[ScanCode["NumpadComma"] = 134] = "NumpadComma";
    ScanCode[ScanCode["IntlRo"] = 135] = "IntlRo";
    ScanCode[ScanCode["KanaMode"] = 136] = "KanaMode";
    ScanCode[ScanCode["IntlYen"] = 137] = "IntlYen";
    ScanCode[ScanCode["Convert"] = 138] = "Convert";
    ScanCode[ScanCode["NonConvert"] = 139] = "NonConvert";
    ScanCode[ScanCode["Lang1"] = 140] = "Lang1";
    ScanCode[ScanCode["Lang2"] = 141] = "Lang2";
    ScanCode[ScanCode["Lang3"] = 142] = "Lang3";
    ScanCode[ScanCode["Lang4"] = 143] = "Lang4";
    ScanCode[ScanCode["Lang5"] = 144] = "Lang5";
    ScanCode[ScanCode["Abort"] = 145] = "Abort";
    ScanCode[ScanCode["Props"] = 146] = "Props";
    ScanCode[ScanCode["NumpadParenLeft"] = 147] = "NumpadParenLeft";
    ScanCode[ScanCode["NumpadParenRight"] = 148] = "NumpadParenRight";
    ScanCode[ScanCode["NumpadBackspace"] = 149] = "NumpadBackspace";
    ScanCode[ScanCode["NumpadMemoryStore"] = 150] = "NumpadMemoryStore";
    ScanCode[ScanCode["NumpadMemoryRecall"] = 151] = "NumpadMemoryRecall";
    ScanCode[ScanCode["NumpadMemoryClear"] = 152] = "NumpadMemoryClear";
    ScanCode[ScanCode["NumpadMemoryAdd"] = 153] = "NumpadMemoryAdd";
    ScanCode[ScanCode["NumpadMemorySubtract"] = 154] = "NumpadMemorySubtract";
    ScanCode[ScanCode["NumpadClear"] = 155] = "NumpadClear";
    ScanCode[ScanCode["NumpadClearEntry"] = 156] = "NumpadClearEntry";
    ScanCode[ScanCode["ControlLeft"] = 157] = "ControlLeft";
    ScanCode[ScanCode["ShiftLeft"] = 158] = "ShiftLeft";
    ScanCode[ScanCode["AltLeft"] = 159] = "AltLeft";
    ScanCode[ScanCode["MetaLeft"] = 160] = "MetaLeft";
    ScanCode[ScanCode["ControlRight"] = 161] = "ControlRight";
    ScanCode[ScanCode["ShiftRight"] = 162] = "ShiftRight";
    ScanCode[ScanCode["AltRight"] = 163] = "AltRight";
    ScanCode[ScanCode["MetaRight"] = 164] = "MetaRight";
    ScanCode[ScanCode["BrightnessUp"] = 165] = "BrightnessUp";
    ScanCode[ScanCode["BrightnessDown"] = 166] = "BrightnessDown";
    ScanCode[ScanCode["MediaPlay"] = 167] = "MediaPlay";
    ScanCode[ScanCode["MediaRecord"] = 168] = "MediaRecord";
    ScanCode[ScanCode["MediaFastForward"] = 169] = "MediaFastForward";
    ScanCode[ScanCode["MediaRewind"] = 170] = "MediaRewind";
    ScanCode[ScanCode["MediaTrackNext"] = 171] = "MediaTrackNext";
    ScanCode[ScanCode["MediaTrackPrevious"] = 172] = "MediaTrackPrevious";
    ScanCode[ScanCode["MediaStop"] = 173] = "MediaStop";
    ScanCode[ScanCode["Eject"] = 174] = "Eject";
    ScanCode[ScanCode["MediaPlayPause"] = 175] = "MediaPlayPause";
    ScanCode[ScanCode["MediaSelect"] = 176] = "MediaSelect";
    ScanCode[ScanCode["LaunchMail"] = 177] = "LaunchMail";
    ScanCode[ScanCode["LaunchApp2"] = 178] = "LaunchApp2";
    ScanCode[ScanCode["LaunchApp1"] = 179] = "LaunchApp1";
    ScanCode[ScanCode["SelectTask"] = 180] = "SelectTask";
    ScanCode[ScanCode["LaunchScreenSaver"] = 181] = "LaunchScreenSaver";
    ScanCode[ScanCode["BrowserSearch"] = 182] = "BrowserSearch";
    ScanCode[ScanCode["BrowserHome"] = 183] = "BrowserHome";
    ScanCode[ScanCode["BrowserBack"] = 184] = "BrowserBack";
    ScanCode[ScanCode["BrowserForward"] = 185] = "BrowserForward";
    ScanCode[ScanCode["BrowserStop"] = 186] = "BrowserStop";
    ScanCode[ScanCode["BrowserRefresh"] = 187] = "BrowserRefresh";
    ScanCode[ScanCode["BrowserFavorites"] = 188] = "BrowserFavorites";
    ScanCode[ScanCode["ZoomToggle"] = 189] = "ZoomToggle";
    ScanCode[ScanCode["MailReply"] = 190] = "MailReply";
    ScanCode[ScanCode["MailForward"] = 191] = "MailForward";
    ScanCode[ScanCode["MailSend"] = 192] = "MailSend";
    ScanCode[ScanCode["MAX_VALUE"] = 193] = "MAX_VALUE";
})(ScanCode || (ScanCode = {}));
class KeyCodeStrMap {
    constructor() {
        this._keyCodeToStr = [];
        this._strToKeyCode = Object.create(null);
    }
    define(keyCode, str) {
        this._keyCodeToStr[keyCode] = str;
        this._strToKeyCode[str.toLowerCase()] = keyCode;
    }
    keyCodeToStr(keyCode) {
        return this._keyCodeToStr[keyCode];
    }
    strToKeyCode(str) {
        return this._strToKeyCode[str.toLowerCase()] || KeyCode.Unknown;
    }
}
const uiMap = ( new KeyCodeStrMap());
const userSettingsUSMap = ( new KeyCodeStrMap());
const userSettingsGeneralMap = ( new KeyCodeStrMap());
const EVENT_KEY_CODE_MAP = ( new Array(230));
const NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE = {};
const scanCodeIntToStr = [];
const scanCodeStrToInt = Object.create(null);
const scanCodeLowerCaseStrToInt = Object.create(null);
const ScanCodeUtils = {
    lowerCaseToEnum: scanCode => scanCodeLowerCaseStrToInt[scanCode] || ScanCode.None,
    toEnum: scanCode => scanCodeStrToInt[scanCode] || ScanCode.None,
    toString: scanCode => scanCodeIntToStr[scanCode] || "None"
};
const IMMUTABLE_CODE_TO_KEY_CODE = [];
const IMMUTABLE_KEY_CODE_TO_CODE = [];
for (let i = 0; i <= ScanCode.MAX_VALUE; i++) {
    IMMUTABLE_CODE_TO_KEY_CODE[i] = KeyCode.DependsOnKbLayout;
}
for (let i = 0; i <= KeyCode.MAX_VALUE; i++) {
    IMMUTABLE_KEY_CODE_TO_CODE[i] = ScanCode.DependsOnKbLayout;
}
(function() {
    const empty = "";
    const mappings = [
        [
            1,
            ScanCode.None,
            "None",
            KeyCode.Unknown,
            "unknown",
            0,
            "VK_UNKNOWN",
            empty,
            empty
        ],
        [1, ScanCode.Hyper, "Hyper", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Super, "Super", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Fn, "Fn", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [
            1,
            ScanCode.FnLock,
            "FnLock",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.Suspend,
            "Suspend",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.Resume,
            "Resume",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [1, ScanCode.Turbo, "Turbo", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [
            1,
            ScanCode.Sleep,
            "Sleep",
            KeyCode.Unknown,
            empty,
            0,
            "VK_SLEEP",
            empty,
            empty
        ],
        [
            1,
            ScanCode.WakeUp,
            "WakeUp",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [0, ScanCode.KeyA, "KeyA", KeyCode.KeyA, "A", 65, "VK_A", empty, empty],
        [0, ScanCode.KeyB, "KeyB", KeyCode.KeyB, "B", 66, "VK_B", empty, empty],
        [0, ScanCode.KeyC, "KeyC", KeyCode.KeyC, "C", 67, "VK_C", empty, empty],
        [0, ScanCode.KeyD, "KeyD", KeyCode.KeyD, "D", 68, "VK_D", empty, empty],
        [0, ScanCode.KeyE, "KeyE", KeyCode.KeyE, "E", 69, "VK_E", empty, empty],
        [0, ScanCode.KeyF, "KeyF", KeyCode.KeyF, "F", 70, "VK_F", empty, empty],
        [0, ScanCode.KeyG, "KeyG", KeyCode.KeyG, "G", 71, "VK_G", empty, empty],
        [0, ScanCode.KeyH, "KeyH", KeyCode.KeyH, "H", 72, "VK_H", empty, empty],
        [0, ScanCode.KeyI, "KeyI", KeyCode.KeyI, "I", 73, "VK_I", empty, empty],
        [0, ScanCode.KeyJ, "KeyJ", KeyCode.KeyJ, "J", 74, "VK_J", empty, empty],
        [0, ScanCode.KeyK, "KeyK", KeyCode.KeyK, "K", 75, "VK_K", empty, empty],
        [0, ScanCode.KeyL, "KeyL", KeyCode.KeyL, "L", 76, "VK_L", empty, empty],
        [0, ScanCode.KeyM, "KeyM", KeyCode.KeyM, "M", 77, "VK_M", empty, empty],
        [0, ScanCode.KeyN, "KeyN", KeyCode.KeyN, "N", 78, "VK_N", empty, empty],
        [0, ScanCode.KeyO, "KeyO", KeyCode.KeyO, "O", 79, "VK_O", empty, empty],
        [0, ScanCode.KeyP, "KeyP", KeyCode.KeyP, "P", 80, "VK_P", empty, empty],
        [0, ScanCode.KeyQ, "KeyQ", KeyCode.KeyQ, "Q", 81, "VK_Q", empty, empty],
        [0, ScanCode.KeyR, "KeyR", KeyCode.KeyR, "R", 82, "VK_R", empty, empty],
        [0, ScanCode.KeyS, "KeyS", KeyCode.KeyS, "S", 83, "VK_S", empty, empty],
        [0, ScanCode.KeyT, "KeyT", KeyCode.KeyT, "T", 84, "VK_T", empty, empty],
        [0, ScanCode.KeyU, "KeyU", KeyCode.KeyU, "U", 85, "VK_U", empty, empty],
        [0, ScanCode.KeyV, "KeyV", KeyCode.KeyV, "V", 86, "VK_V", empty, empty],
        [0, ScanCode.KeyW, "KeyW", KeyCode.KeyW, "W", 87, "VK_W", empty, empty],
        [0, ScanCode.KeyX, "KeyX", KeyCode.KeyX, "X", 88, "VK_X", empty, empty],
        [0, ScanCode.KeyY, "KeyY", KeyCode.KeyY, "Y", 89, "VK_Y", empty, empty],
        [0, ScanCode.KeyZ, "KeyZ", KeyCode.KeyZ, "Z", 90, "VK_Z", empty, empty],
        [
            0,
            ScanCode.Digit1,
            "Digit1",
            KeyCode.Digit1,
            "1",
            49,
            "VK_1",
            empty,
            empty
        ],
        [
            0,
            ScanCode.Digit2,
            "Digit2",
            KeyCode.Digit2,
            "2",
            50,
            "VK_2",
            empty,
            empty
        ],
        [
            0,
            ScanCode.Digit3,
            "Digit3",
            KeyCode.Digit3,
            "3",
            51,
            "VK_3",
            empty,
            empty
        ],
        [
            0,
            ScanCode.Digit4,
            "Digit4",
            KeyCode.Digit4,
            "4",
            52,
            "VK_4",
            empty,
            empty
        ],
        [
            0,
            ScanCode.Digit5,
            "Digit5",
            KeyCode.Digit5,
            "5",
            53,
            "VK_5",
            empty,
            empty
        ],
        [
            0,
            ScanCode.Digit6,
            "Digit6",
            KeyCode.Digit6,
            "6",
            54,
            "VK_6",
            empty,
            empty
        ],
        [
            0,
            ScanCode.Digit7,
            "Digit7",
            KeyCode.Digit7,
            "7",
            55,
            "VK_7",
            empty,
            empty
        ],
        [
            0,
            ScanCode.Digit8,
            "Digit8",
            KeyCode.Digit8,
            "8",
            56,
            "VK_8",
            empty,
            empty
        ],
        [
            0,
            ScanCode.Digit9,
            "Digit9",
            KeyCode.Digit9,
            "9",
            57,
            "VK_9",
            empty,
            empty
        ],
        [
            0,
            ScanCode.Digit0,
            "Digit0",
            KeyCode.Digit0,
            "0",
            48,
            "VK_0",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Enter,
            "Enter",
            KeyCode.Enter,
            "Enter",
            13,
            "VK_RETURN",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Escape,
            "Escape",
            KeyCode.Escape,
            "Escape",
            27,
            "VK_ESCAPE",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Backspace,
            "Backspace",
            KeyCode.Backspace,
            "Backspace",
            8,
            "VK_BACK",
            empty,
            empty
        ],
        [1, ScanCode.Tab, "Tab", KeyCode.Tab, "Tab", 9, "VK_TAB", empty, empty],
        [
            1,
            ScanCode.Space,
            "Space",
            KeyCode.Space,
            "Space",
            32,
            "VK_SPACE",
            empty,
            empty
        ],
        [
            0,
            ScanCode.Minus,
            "Minus",
            KeyCode.Minus,
            "-",
            189,
            "VK_OEM_MINUS",
            "-",
            "OEM_MINUS"
        ],
        [
            0,
            ScanCode.Equal,
            "Equal",
            KeyCode.Equal,
            "=",
            187,
            "VK_OEM_PLUS",
            "=",
            "OEM_PLUS"
        ],
        [
            0,
            ScanCode.BracketLeft,
            "BracketLeft",
            KeyCode.BracketLeft,
            "[",
            219,
            "VK_OEM_4",
            "[",
            "OEM_4"
        ],
        [
            0,
            ScanCode.BracketRight,
            "BracketRight",
            KeyCode.BracketRight,
            "]",
            221,
            "VK_OEM_6",
            "]",
            "OEM_6"
        ],
        [
            0,
            ScanCode.Backslash,
            "Backslash",
            KeyCode.Backslash,
            "\\",
            220,
            "VK_OEM_5",
            "\\",
            "OEM_5"
        ],
        [
            0,
            ScanCode.IntlHash,
            "IntlHash",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            0,
            ScanCode.Semicolon,
            "Semicolon",
            KeyCode.Semicolon,
            ";",
            186,
            "VK_OEM_1",
            ";",
            "OEM_1"
        ],
        [
            0,
            ScanCode.Quote,
            "Quote",
            KeyCode.Quote,
            "'",
            222,
            "VK_OEM_7",
            "'",
            "OEM_7"
        ],
        [
            0,
            ScanCode.Backquote,
            "Backquote",
            KeyCode.Backquote,
            "`",
            192,
            "VK_OEM_3",
            "`",
            "OEM_3"
        ],
        [
            0,
            ScanCode.Comma,
            "Comma",
            KeyCode.Comma,
            ",",
            188,
            "VK_OEM_COMMA",
            ",",
            "OEM_COMMA"
        ],
        [
            0,
            ScanCode.Period,
            "Period",
            KeyCode.Period,
            ".",
            190,
            "VK_OEM_PERIOD",
            ".",
            "OEM_PERIOD"
        ],
        [
            0,
            ScanCode.Slash,
            "Slash",
            KeyCode.Slash,
            "/",
            191,
            "VK_OEM_2",
            "/",
            "OEM_2"
        ],
        [
            1,
            ScanCode.CapsLock,
            "CapsLock",
            KeyCode.CapsLock,
            "CapsLock",
            20,
            "VK_CAPITAL",
            empty,
            empty
        ],
        [1, ScanCode.F1, "F1", KeyCode.F1, "F1", 112, "VK_F1", empty, empty],
        [1, ScanCode.F2, "F2", KeyCode.F2, "F2", 113, "VK_F2", empty, empty],
        [1, ScanCode.F3, "F3", KeyCode.F3, "F3", 114, "VK_F3", empty, empty],
        [1, ScanCode.F4, "F4", KeyCode.F4, "F4", 115, "VK_F4", empty, empty],
        [1, ScanCode.F5, "F5", KeyCode.F5, "F5", 116, "VK_F5", empty, empty],
        [1, ScanCode.F6, "F6", KeyCode.F6, "F6", 117, "VK_F6", empty, empty],
        [1, ScanCode.F7, "F7", KeyCode.F7, "F7", 118, "VK_F7", empty, empty],
        [1, ScanCode.F8, "F8", KeyCode.F8, "F8", 119, "VK_F8", empty, empty],
        [1, ScanCode.F9, "F9", KeyCode.F9, "F9", 120, "VK_F9", empty, empty],
        [1, ScanCode.F10, "F10", KeyCode.F10, "F10", 121, "VK_F10", empty, empty],
        [1, ScanCode.F11, "F11", KeyCode.F11, "F11", 122, "VK_F11", empty, empty],
        [1, ScanCode.F12, "F12", KeyCode.F12, "F12", 123, "VK_F12", empty, empty],
        [
            1,
            ScanCode.PrintScreen,
            "PrintScreen",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.ScrollLock,
            "ScrollLock",
            KeyCode.ScrollLock,
            "ScrollLock",
            145,
            "VK_SCROLL",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Pause,
            "Pause",
            KeyCode.PauseBreak,
            "PauseBreak",
            19,
            "VK_PAUSE",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Insert,
            "Insert",
            KeyCode.Insert,
            "Insert",
            45,
            "VK_INSERT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Home,
            "Home",
            KeyCode.Home,
            "Home",
            36,
            "VK_HOME",
            empty,
            empty
        ],
        [
            1,
            ScanCode.PageUp,
            "PageUp",
            KeyCode.PageUp,
            "PageUp",
            33,
            "VK_PRIOR",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Delete,
            "Delete",
            KeyCode.Delete,
            "Delete",
            46,
            "VK_DELETE",
            empty,
            empty
        ],
        [1, ScanCode.End, "End", KeyCode.End, "End", 35, "VK_END", empty, empty],
        [
            1,
            ScanCode.PageDown,
            "PageDown",
            KeyCode.PageDown,
            "PageDown",
            34,
            "VK_NEXT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.ArrowRight,
            "ArrowRight",
            KeyCode.RightArrow,
            "RightArrow",
            39,
            "VK_RIGHT",
            "Right",
            empty
        ],
        [
            1,
            ScanCode.ArrowLeft,
            "ArrowLeft",
            KeyCode.LeftArrow,
            "LeftArrow",
            37,
            "VK_LEFT",
            "Left",
            empty
        ],
        [
            1,
            ScanCode.ArrowDown,
            "ArrowDown",
            KeyCode.DownArrow,
            "DownArrow",
            40,
            "VK_DOWN",
            "Down",
            empty
        ],
        [
            1,
            ScanCode.ArrowUp,
            "ArrowUp",
            KeyCode.UpArrow,
            "UpArrow",
            38,
            "VK_UP",
            "Up",
            empty
        ],
        [
            1,
            ScanCode.NumLock,
            "NumLock",
            KeyCode.NumLock,
            "NumLock",
            144,
            "VK_NUMLOCK",
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadDivide,
            "NumpadDivide",
            KeyCode.NumpadDivide,
            "NumPad_Divide",
            111,
            "VK_DIVIDE",
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadMultiply,
            "NumpadMultiply",
            KeyCode.NumpadMultiply,
            "NumPad_Multiply",
            106,
            "VK_MULTIPLY",
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadSubtract,
            "NumpadSubtract",
            KeyCode.NumpadSubtract,
            "NumPad_Subtract",
            109,
            "VK_SUBTRACT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadAdd,
            "NumpadAdd",
            KeyCode.NumpadAdd,
            "NumPad_Add",
            107,
            "VK_ADD",
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadEnter,
            "NumpadEnter",
            KeyCode.Enter,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.Numpad1,
            "Numpad1",
            KeyCode.Numpad1,
            "NumPad1",
            97,
            "VK_NUMPAD1",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Numpad2,
            "Numpad2",
            KeyCode.Numpad2,
            "NumPad2",
            98,
            "VK_NUMPAD2",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Numpad3,
            "Numpad3",
            KeyCode.Numpad3,
            "NumPad3",
            99,
            "VK_NUMPAD3",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Numpad4,
            "Numpad4",
            KeyCode.Numpad4,
            "NumPad4",
            100,
            "VK_NUMPAD4",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Numpad5,
            "Numpad5",
            KeyCode.Numpad5,
            "NumPad5",
            101,
            "VK_NUMPAD5",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Numpad6,
            "Numpad6",
            KeyCode.Numpad6,
            "NumPad6",
            102,
            "VK_NUMPAD6",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Numpad7,
            "Numpad7",
            KeyCode.Numpad7,
            "NumPad7",
            103,
            "VK_NUMPAD7",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Numpad8,
            "Numpad8",
            KeyCode.Numpad8,
            "NumPad8",
            104,
            "VK_NUMPAD8",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Numpad9,
            "Numpad9",
            KeyCode.Numpad9,
            "NumPad9",
            105,
            "VK_NUMPAD9",
            empty,
            empty
        ],
        [
            1,
            ScanCode.Numpad0,
            "Numpad0",
            KeyCode.Numpad0,
            "NumPad0",
            96,
            "VK_NUMPAD0",
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadDecimal,
            "NumpadDecimal",
            KeyCode.NumpadDecimal,
            "NumPad_Decimal",
            110,
            "VK_DECIMAL",
            empty,
            empty
        ],
        [
            0,
            ScanCode.IntlBackslash,
            "IntlBackslash",
            KeyCode.IntlBackslash,
            "OEM_102",
            226,
            "VK_OEM_102",
            empty,
            empty
        ],
        [
            1,
            ScanCode.ContextMenu,
            "ContextMenu",
            KeyCode.ContextMenu,
            "ContextMenu",
            93,
            empty,
            empty,
            empty
        ],
        [1, ScanCode.Power, "Power", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [
            1,
            ScanCode.NumpadEqual,
            "NumpadEqual",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [1, ScanCode.F13, "F13", KeyCode.F13, "F13", 124, "VK_F13", empty, empty],
        [1, ScanCode.F14, "F14", KeyCode.F14, "F14", 125, "VK_F14", empty, empty],
        [1, ScanCode.F15, "F15", KeyCode.F15, "F15", 126, "VK_F15", empty, empty],
        [1, ScanCode.F16, "F16", KeyCode.F16, "F16", 127, "VK_F16", empty, empty],
        [1, ScanCode.F17, "F17", KeyCode.F17, "F17", 128, "VK_F17", empty, empty],
        [1, ScanCode.F18, "F18", KeyCode.F18, "F18", 129, "VK_F18", empty, empty],
        [1, ScanCode.F19, "F19", KeyCode.F19, "F19", 130, "VK_F19", empty, empty],
        [1, ScanCode.F20, "F20", KeyCode.F20, "F20", 131, "VK_F20", empty, empty],
        [1, ScanCode.F21, "F21", KeyCode.F21, "F21", 132, "VK_F21", empty, empty],
        [1, ScanCode.F22, "F22", KeyCode.F22, "F22", 133, "VK_F22", empty, empty],
        [1, ScanCode.F23, "F23", KeyCode.F23, "F23", 134, "VK_F23", empty, empty],
        [1, ScanCode.F24, "F24", KeyCode.F24, "F24", 135, "VK_F24", empty, empty],
        [1, ScanCode.Open, "Open", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Help, "Help", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [
            1,
            ScanCode.Select,
            "Select",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [1, ScanCode.Again, "Again", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Undo, "Undo", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Cut, "Cut", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Copy, "Copy", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Paste, "Paste", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Find, "Find", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [
            1,
            ScanCode.AudioVolumeMute,
            "AudioVolumeMute",
            KeyCode.AudioVolumeMute,
            "AudioVolumeMute",
            173,
            "VK_VOLUME_MUTE",
            empty,
            empty
        ],
        [
            1,
            ScanCode.AudioVolumeUp,
            "AudioVolumeUp",
            KeyCode.AudioVolumeUp,
            "AudioVolumeUp",
            175,
            "VK_VOLUME_UP",
            empty,
            empty
        ],
        [
            1,
            ScanCode.AudioVolumeDown,
            "AudioVolumeDown",
            KeyCode.AudioVolumeDown,
            "AudioVolumeDown",
            174,
            "VK_VOLUME_DOWN",
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadComma,
            "NumpadComma",
            KeyCode.NUMPAD_SEPARATOR,
            "NumPad_Separator",
            108,
            "VK_SEPARATOR",
            empty,
            empty
        ],
        [
            0,
            ScanCode.IntlRo,
            "IntlRo",
            KeyCode.ABNT_C1,
            "ABNT_C1",
            193,
            "VK_ABNT_C1",
            empty,
            empty
        ],
        [
            1,
            ScanCode.KanaMode,
            "KanaMode",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            0,
            ScanCode.IntlYen,
            "IntlYen",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.Convert,
            "Convert",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.NonConvert,
            "NonConvert",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [1, ScanCode.Lang1, "Lang1", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Lang2, "Lang2", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Lang3, "Lang3", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Lang4, "Lang4", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Lang5, "Lang5", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Abort, "Abort", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [1, ScanCode.Props, "Props", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [
            1,
            ScanCode.NumpadParenLeft,
            "NumpadParenLeft",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadParenRight,
            "NumpadParenRight",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadBackspace,
            "NumpadBackspace",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadMemoryStore,
            "NumpadMemoryStore",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadMemoryRecall,
            "NumpadMemoryRecall",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadMemoryClear,
            "NumpadMemoryClear",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadMemoryAdd,
            "NumpadMemoryAdd",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadMemorySubtract,
            "NumpadMemorySubtract",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadClear,
            "NumpadClear",
            KeyCode.Clear,
            "Clear",
            12,
            "VK_CLEAR",
            empty,
            empty
        ],
        [
            1,
            ScanCode.NumpadClearEntry,
            "NumpadClearEntry",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Ctrl,
            "Ctrl",
            17,
            "VK_CONTROL",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Shift,
            "Shift",
            16,
            "VK_SHIFT",
            empty,
            empty
        ],
        [1, ScanCode.None, empty, KeyCode.Alt, "Alt", 18, "VK_MENU", empty, empty],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Meta,
            "Meta",
            91,
            "VK_COMMAND",
            empty,
            empty
        ],
        [
            1,
            ScanCode.ControlLeft,
            "ControlLeft",
            KeyCode.Ctrl,
            empty,
            0,
            "VK_LCONTROL",
            empty,
            empty
        ],
        [
            1,
            ScanCode.ShiftLeft,
            "ShiftLeft",
            KeyCode.Shift,
            empty,
            0,
            "VK_LSHIFT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.AltLeft,
            "AltLeft",
            KeyCode.Alt,
            empty,
            0,
            "VK_LMENU",
            empty,
            empty
        ],
        [
            1,
            ScanCode.MetaLeft,
            "MetaLeft",
            KeyCode.Meta,
            empty,
            0,
            "VK_LWIN",
            empty,
            empty
        ],
        [
            1,
            ScanCode.ControlRight,
            "ControlRight",
            KeyCode.Ctrl,
            empty,
            0,
            "VK_RCONTROL",
            empty,
            empty
        ],
        [
            1,
            ScanCode.ShiftRight,
            "ShiftRight",
            KeyCode.Shift,
            empty,
            0,
            "VK_RSHIFT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.AltRight,
            "AltRight",
            KeyCode.Alt,
            empty,
            0,
            "VK_RMENU",
            empty,
            empty
        ],
        [
            1,
            ScanCode.MetaRight,
            "MetaRight",
            KeyCode.Meta,
            empty,
            0,
            "VK_RWIN",
            empty,
            empty
        ],
        [
            1,
            ScanCode.BrightnessUp,
            "BrightnessUp",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.BrightnessDown,
            "BrightnessDown",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.MediaPlay,
            "MediaPlay",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.MediaRecord,
            "MediaRecord",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.MediaFastForward,
            "MediaFastForward",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.MediaRewind,
            "MediaRewind",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.MediaTrackNext,
            "MediaTrackNext",
            KeyCode.MediaTrackNext,
            "MediaTrackNext",
            176,
            "VK_MEDIA_NEXT_TRACK",
            empty,
            empty
        ],
        [
            1,
            ScanCode.MediaTrackPrevious,
            "MediaTrackPrevious",
            KeyCode.MediaTrackPrevious,
            "MediaTrackPrevious",
            177,
            "VK_MEDIA_PREV_TRACK",
            empty,
            empty
        ],
        [
            1,
            ScanCode.MediaStop,
            "MediaStop",
            KeyCode.MediaStop,
            "MediaStop",
            178,
            "VK_MEDIA_STOP",
            empty,
            empty
        ],
        [1, ScanCode.Eject, "Eject", KeyCode.Unknown, empty, 0, empty, empty, empty],
        [
            1,
            ScanCode.MediaPlayPause,
            "MediaPlayPause",
            KeyCode.MediaPlayPause,
            "MediaPlayPause",
            179,
            "VK_MEDIA_PLAY_PAUSE",
            empty,
            empty
        ],
        [
            1,
            ScanCode.MediaSelect,
            "MediaSelect",
            KeyCode.LaunchMediaPlayer,
            "LaunchMediaPlayer",
            181,
            "VK_MEDIA_LAUNCH_MEDIA_SELECT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.LaunchMail,
            "LaunchMail",
            KeyCode.LaunchMail,
            "LaunchMail",
            180,
            "VK_MEDIA_LAUNCH_MAIL",
            empty,
            empty
        ],
        [
            1,
            ScanCode.LaunchApp2,
            "LaunchApp2",
            KeyCode.LaunchApp2,
            "LaunchApp2",
            183,
            "VK_MEDIA_LAUNCH_APP2",
            empty,
            empty
        ],
        [
            1,
            ScanCode.LaunchApp1,
            "LaunchApp1",
            KeyCode.Unknown,
            empty,
            0,
            "VK_MEDIA_LAUNCH_APP1",
            empty,
            empty
        ],
        [
            1,
            ScanCode.SelectTask,
            "SelectTask",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.LaunchScreenSaver,
            "LaunchScreenSaver",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.BrowserSearch,
            "BrowserSearch",
            KeyCode.BrowserSearch,
            "BrowserSearch",
            170,
            "VK_BROWSER_SEARCH",
            empty,
            empty
        ],
        [
            1,
            ScanCode.BrowserHome,
            "BrowserHome",
            KeyCode.BrowserHome,
            "BrowserHome",
            172,
            "VK_BROWSER_HOME",
            empty,
            empty
        ],
        [
            1,
            ScanCode.BrowserBack,
            "BrowserBack",
            KeyCode.BrowserBack,
            "BrowserBack",
            166,
            "VK_BROWSER_BACK",
            empty,
            empty
        ],
        [
            1,
            ScanCode.BrowserForward,
            "BrowserForward",
            KeyCode.BrowserForward,
            "BrowserForward",
            167,
            "VK_BROWSER_FORWARD",
            empty,
            empty
        ],
        [
            1,
            ScanCode.BrowserStop,
            "BrowserStop",
            KeyCode.Unknown,
            empty,
            0,
            "VK_BROWSER_STOP",
            empty,
            empty
        ],
        [
            1,
            ScanCode.BrowserRefresh,
            "BrowserRefresh",
            KeyCode.Unknown,
            empty,
            0,
            "VK_BROWSER_REFRESH",
            empty,
            empty
        ],
        [
            1,
            ScanCode.BrowserFavorites,
            "BrowserFavorites",
            KeyCode.Unknown,
            empty,
            0,
            "VK_BROWSER_FAVORITES",
            empty,
            empty
        ],
        [
            1,
            ScanCode.ZoomToggle,
            "ZoomToggle",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.MailReply,
            "MailReply",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.MailForward,
            "MailForward",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.MailSend,
            "MailSend",
            KeyCode.Unknown,
            empty,
            0,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.KEY_IN_COMPOSITION,
            "KeyInComposition",
            229,
            empty,
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.ABNT_C2,
            "ABNT_C2",
            194,
            "VK_ABNT_C2",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.OEM_8,
            "OEM_8",
            223,
            "VK_OEM_8",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_KANA",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_HANGUL",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_JUNJA",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_FINAL",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_HANJA",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_KANJI",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_CONVERT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_NONCONVERT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_ACCEPT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_MODECHANGE",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_SELECT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_PRINT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_EXECUTE",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_SNAPSHOT",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_HELP",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_APPS",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_PROCESSKEY",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_PACKET",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_DBE_SBCSCHAR",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_DBE_DBCSCHAR",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_ATTN",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_CRSEL",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_EXSEL",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_EREOF",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_PLAY",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_ZOOM",
            empty,
            empty
        ],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_NONAME",
            empty,
            empty
        ],
        [1, ScanCode.None, empty, KeyCode.Unknown, empty, 0, "VK_PA1", empty, empty],
        [
            1,
            ScanCode.None,
            empty,
            KeyCode.Unknown,
            empty,
            0,
            "VK_OEM_CLEAR",
            empty,
            empty
        ]
    ];
    const seenKeyCode = [];
    const seenScanCode = [];
    for (const mapping of mappings) {
        const [
            immutable,
            scanCode,
            scanCodeStr,
            keyCode,
            keyCodeStr,
            eventKeyCode,
            vkey,
            usUserSettingsLabel,
            generalUserSettingsLabel
        ] = mapping;
        if (!seenScanCode[scanCode]) {
            seenScanCode[scanCode] = true;
            scanCodeIntToStr[scanCode] = scanCodeStr;
            scanCodeStrToInt[scanCodeStr] = scanCode;
            scanCodeLowerCaseStrToInt[scanCodeStr.toLowerCase()] = scanCode;
            if (immutable) {
                IMMUTABLE_CODE_TO_KEY_CODE[scanCode] = keyCode;
                if ((keyCode !== KeyCode.Unknown) && (keyCode !== KeyCode.Enter) && !isModifierKey(keyCode)) {
                    IMMUTABLE_KEY_CODE_TO_CODE[keyCode] = scanCode;
                }
            }
        }
        if (!seenKeyCode[keyCode]) {
            seenKeyCode[keyCode] = true;
            if (!keyCodeStr) {
                throw ( new Error(
                    `String representation missing for key code ${keyCode} around scan code ${scanCodeStr}`
                ));
            }
            uiMap.define(keyCode, keyCodeStr);
            userSettingsUSMap.define(keyCode, usUserSettingsLabel || keyCodeStr);
            userSettingsGeneralMap.define(keyCode, generalUserSettingsLabel || usUserSettingsLabel || keyCodeStr);
        }
        if (eventKeyCode) {
            EVENT_KEY_CODE_MAP[eventKeyCode] = keyCode;
        }
        if (vkey) {
            NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE[vkey] = keyCode;
        }
    }
    IMMUTABLE_KEY_CODE_TO_CODE[KeyCode.Enter] = ScanCode.Enter;
})();
var KeyCodeUtils;
(function(KeyCodeUtils) {
    function toString(keyCode) {
        return uiMap.keyCodeToStr(keyCode);
    }
    KeyCodeUtils.toString = toString;
    function fromString(key) {
        return uiMap.strToKeyCode(key);
    }
    KeyCodeUtils.fromString = fromString;
    function toUserSettingsUS(keyCode) {
        return userSettingsUSMap.keyCodeToStr(keyCode);
    }
    KeyCodeUtils.toUserSettingsUS = toUserSettingsUS;
    function toUserSettingsGeneral(keyCode) {
        return userSettingsGeneralMap.keyCodeToStr(keyCode);
    }
    KeyCodeUtils.toUserSettingsGeneral = toUserSettingsGeneral;
    function fromUserSettings(key) {
        return userSettingsUSMap.strToKeyCode(key) || userSettingsGeneralMap.strToKeyCode(key);
    }
    KeyCodeUtils.fromUserSettings = fromUserSettings;
    function toElectronAccelerator(keyCode) {
        if (keyCode >= KeyCode.Numpad0 && keyCode <= KeyCode.NumpadDivide) {
            return null;
        }
        switch (keyCode) {
        case KeyCode.UpArrow:
            return "Up";
        case KeyCode.DownArrow:
            return "Down";
        case KeyCode.LeftArrow:
            return "Left";
        case KeyCode.RightArrow:
            return "Right";
        }
        return uiMap.keyCodeToStr(keyCode);
    }
    KeyCodeUtils.toElectronAccelerator = toElectronAccelerator;
})(KeyCodeUtils || (KeyCodeUtils = {}));
var KeyMod$1;
(function(KeyMod) {
    KeyMod[KeyMod["CtrlCmd"] = 2048] = "CtrlCmd";
    KeyMod[KeyMod["Shift"] = 1024] = "Shift";
    KeyMod[KeyMod["Alt"] = 512] = "Alt";
    KeyMod[KeyMod["WinCtrl"] = 256] = "WinCtrl";
})(KeyMod$1 || (KeyMod$1 = {}));
function KeyChord(firstPart, secondPart) {
    const chordPart = ((secondPart & 0x0000FFFF) << 16) >>> 0;
    return (firstPart | chordPart) >>> 0;
}
function isModifierKey(keyCode) {
    return (keyCode === KeyCode.Ctrl || keyCode === KeyCode.Shift || keyCode === KeyCode.Alt || keyCode === KeyCode.Meta);
}

export { EVENT_KEY_CODE_MAP, IMMUTABLE_CODE_TO_KEY_CODE, IMMUTABLE_KEY_CODE_TO_CODE, KeyChord, KeyCode, KeyCodeUtils, KeyMod$1 as KeyMod, NATIVE_WINDOWS_KEY_CODE_TO_KEY_CODE, ScanCode, ScanCodeUtils, isModifierKey };
