const keys = { 255: 'Ÿ', 247: '÷', 223: 'ß', 222: 'Þ', 221: 'Ý', 220: 'Ü', 16777312: 'ៀ?', 219: 'Û', 212: 'Ô', 211: 'Ó', 210: 'Ò', 16777302: 'ៀ?', 209: 'Ñ', 16777301: 'Menu', 208: 'Ð', 16777300: 'ៀ?', 207: 'Ï', 16777299: 'ៀ?', 206: 'Î', 16777298: 'F35', 205: 'Í', 16777297: 'F34', 204: 'Ì', 16777296: 'F33', 203: 'Ë', 16777295: 'F32', 202: 'Ê', 16777294: 'F31', 201: 'É', 16777293: 'F30', 200: 'È', 16777292: 'F29', 199: 'Ç', 16777291: 'F28', 198: 'Æ', 16777290: 'F27', 197: 'Å', 16777289: 'F26', 196: 'Ä', 16777288: 'F25', 195: 'Ã', 16777287: 'F24', 194: 'Â', 16777286: 'F23', 193: 'Á', 16777285: 'F22', 192: 'À', 16777284: 'F21', 191: '¿', 16777283: 'F20', 190: '¾', 16777282: 'F19', 189: '½', 16777281: 'F18', 188: '¼', 16777280: 'F17', 187: '»', 16777279: 'F16', 186: 'º', 33: '!', 16777237: 'Down', 57: '9', 181: 'Μ', 40: '(', 16777220: 'Return', 50: '2', 174: '®', 39: '\'', 16777219: 'Backspace', 126: '~', 49: '1', 173: '­', 38: '&', 16777218: 'Backtab', 16777305: 'ៀ?', 125: '}', 48: '0', 172: '¬', 16777303: 'ៀ?', 123: '{', 16777304: 'Help', 124: '|', 16777227: 'Clear', 47: '/', 171: '«', 41: ')', 16777221: 'Enter', 51: '3', 175: '¯', 42: '*', 16777222: 'Ins', 16777232: 'Home', 52: '4', 176: '°', 43: '+', 16777223: 'Del', 16777233: 'End', 53: '5', 177: '±', 44: ',', 16777224: 'Pause', 16777234: 'Left', 54: '6', 178: '²', 45: '-', 16777225: 'Print', 16777235: 'Up', 55: '7', 179: '³', 32: 'Space', 46: '.', 16777226: 'SysReq', 16777236: 'Right', 56: '8', 180: '´', 34: '"', 35: '#', 16777216: 'Esc', 36: '$', 160: ' ', 16777217: 'Tab', 37: '%', 161: '¡', 16777238: 'PgUp', 58: ':', 182: '¶', 183: '·', 16777277: 'F14', 184: '¸', 16777278: 'F15', 185: '¹', 16777239: 'PgDown', 59: ';', 60: '<', 61: '=', 62: '>', 63: '?', 64: '@', 65: 'A', 66: 'B', 67: 'C', 16777248: 'ៀ?', 68: 'D', 16777249: 'ៀ?', 69: 'E', 16777250: 'ៀ?', 70: 'F', 16777251: 'ៀ?', 71: 'G', 16777252: 'CapsLock', 72: 'H', 16777253: 'NumLock', 73: 'I', 16777254: 'ScrollLock', 74: 'J', 75: 'K', 76: 'L', 77: 'M', 78: 'N', 79: 'O', 80: 'P', 81: 'Q', 82: 'R', 83: 'S', 16777264: 'F1', 84: 'T', 16777265: 'F2', 85: 'U', 16777266: 'F3', 86: 'V', 16777267: 'F4', 87: 'W', 16777268: 'F5', 88: 'X', 16777269: 'F6', 89: 'Y', 16777270: 'F7', 90: 'Z', 16777271: 'F8', 91: '[', 16777272: 'F9', 92: '\\', 16777273: 'F10', 93: ']', 16777274: 'F11', 94: '^', 16777275: 'F12', 95: '_', 16777276: 'F13', 96: '`', 162: '¢', 163: '£', 164: '¤', 165: '¥', 166: '¦', 167: '§', 168: '¨', 169: '©', 170: 'ª', 213: 'Õ', 214: 'Ö', 215: '×', 216: 'Ø', 217: 'Ù', 218: 'Ú', }; const menu = { 'Menu/File/New': { path: ['File', 'New Document'], shortcut: { key: 78, modifiers: [16777249, ] } }, 'Menu/File/Open...': { path: ['File', 'Open Document...'], shortcut: { key: 79, modifiers: [16777249, ] } }, 'Menu/File/Save': { path: ['File', 'Save Document'], shortcut: { key: 83, modifiers: [16777249, ] } }, 'Menu/File/Save as...': { path: ['File', 'Save Document as...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/File/Export/Wavefront OBJ...': { path: ['File', 'Export', 'Wavefront OBJ...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/File/Load Point File...': { path: ['File', 'Load Point File...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/File/Reload Point File': { path: ['File', 'Reload Point File'], shortcut: { key: 0, modifiers: [] } }, 'Menu/File/Unload Point File': { path: ['File', 'Unload Point File'], shortcut: { key: 0, modifiers: [] } }, 'Menu/File/Load Portal File...': { path: ['File', 'Load Portal File...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/File/Reload Portal File': { path: ['File', 'Reload Portal File'], shortcut: { key: 0, modifiers: [] } }, 'Menu/File/Unload Portal File': { path: ['File', 'Unload Portal File'], shortcut: { key: 0, modifiers: [] } }, 'Menu/File/Reload Texture Collections': { path: ['File', 'Reload Texture Collections'], shortcut: { key: 16777268, modifiers: [] } }, 'Menu/File/Reload Entity Definitions': { path: ['File', 'Reload Entity Definitions'], shortcut: { key: 16777269, modifiers: [] } }, 'Menu/File/Close': { path: ['File', 'Close Document'], shortcut: { key: 87, modifiers: [16777249, ] } }, 'Menu/Edit/Undo': { path: ['Edit', 'Undo'], shortcut: { key: 90, modifiers: [16777249, ] } }, 'Menu/Edit/Redo': { path: ['Edit', 'Redo'], shortcut: { key: 90, modifiers: [16777248, 16777249, ] } }, 'Menu/Edit/Repeat': { path: ['Edit', 'Repeat Last Commands'], shortcut: { key: 82, modifiers: [16777249, ] } }, 'Menu/Edit/Clear Repeatable Commands': { path: ['Edit', 'Clear Repeatable Commands'], shortcut: { key: 82, modifiers: [16777248, 16777249, ] } }, 'Menu/Edit/Cut': { path: ['Edit', 'Cut'], shortcut: { key: 88, modifiers: [16777249, ] } }, 'Menu/Edit/Copy': { path: ['Edit', 'Copy'], shortcut: { key: 67, modifiers: [16777249, ] } }, 'Menu/Edit/Paste': { path: ['Edit', 'Paste'], shortcut: { key: 86, modifiers: [16777249, ] } }, 'Menu/Edit/Paste at Original Position': { path: ['Edit', 'Paste at Original Position'], shortcut: { key: 86, modifiers: [16777251, 16777249, ] } }, 'Menu/Edit/Duplicate': { path: ['Edit', 'Duplicate'], shortcut: { key: 68, modifiers: [16777249, ] } }, 'Menu/Edit/Delete': { path: ['Edit', 'Delete'], shortcut: { key: 16777223, modifiers: [] } }, 'Menu/Edit/Select All': { path: ['Edit', 'Select All'], shortcut: { key: 65, modifiers: [16777249, ] } }, 'Menu/Edit/Select Siblings': { path: ['Edit', 'Select Siblings'], shortcut: { key: 66, modifiers: [16777249, ] } }, 'Menu/Edit/Select Touching': { path: ['Edit', 'Select Touching'], shortcut: { key: 84, modifiers: [16777249, ] } }, 'Menu/Edit/Select Inside': { path: ['Edit', 'Select Inside'], shortcut: { key: 69, modifiers: [16777249, ] } }, 'Menu/Edit/Select Tall': { path: ['Edit', 'Select Tall'], shortcut: { key: 69, modifiers: [16777248, 16777249, ] } }, 'Menu/Edit/Select by Line Number': { path: ['Edit', 'Select by Line Number...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Edit/Select None': { path: ['Edit', 'Select None'], shortcut: { key: 65, modifiers: [16777248, 16777249, ] } }, 'Menu/Edit/Group': { path: ['Edit', 'Group Selected Objects'], shortcut: { key: 71, modifiers: [16777249, ] } }, 'Menu/Edit/Ungroup': { path: ['Edit', 'Ungroup Selected Objects'], shortcut: { key: 71, modifiers: [16777248, 16777249, ] } }, 'Menu/Edit/Tools/Brush Tool': { path: ['Edit', 'Tools', 'Brush Tool'], shortcut: { key: 66, modifiers: [] } }, 'Menu/Edit/Tools/Clip Tool': { path: ['Edit', 'Tools', 'Clip Tool'], shortcut: { key: 67, modifiers: [] } }, 'Menu/Edit/Tools/Rotate Tool': { path: ['Edit', 'Tools', 'Rotate Tool'], shortcut: { key: 82, modifiers: [] } }, 'Menu/Edit/Tools/Scale Tool': { path: ['Edit', 'Tools', 'Scale Tool'], shortcut: { key: 84, modifiers: [] } }, 'Menu/Edit/Tools/Shear Tool': { path: ['Edit', 'Tools', 'Shear Tool'], shortcut: { key: 71, modifiers: [] } }, 'Menu/Edit/Tools/Vertex Tool': { path: ['Edit', 'Tools', 'Vertex Tool'], shortcut: { key: 86, modifiers: [] } }, 'Menu/Edit/Tools/Edge Tool': { path: ['Edit', 'Tools', 'Edge Tool'], shortcut: { key: 69, modifiers: [] } }, 'Menu/Edit/Tools/Face Tool': { path: ['Edit', 'Tools', 'Face Tool'], shortcut: { key: 70, modifiers: [] } }, 'Menu/Edit/CSG/Convex Merge': { path: ['Edit', 'CSG', 'Convex Merge'], shortcut: { key: 74, modifiers: [16777249, ] } }, 'Menu/Edit/CSG/Subtract': { path: ['Edit', 'CSG', 'Subtract'], shortcut: { key: 75, modifiers: [16777249, ] } }, 'Menu/Edit/CSG/Hollow': { path: ['Edit', 'CSG', 'Hollow'], shortcut: { key: 75, modifiers: [16777248, 16777249, ] } }, 'Menu/Edit/CSG/Intersect': { path: ['Edit', 'CSG', 'Intersect'], shortcut: { key: 76, modifiers: [16777249, ] } }, 'Menu/Edit/Snap Vertices to Integer': { path: ['Edit', 'Snap Vertices to Integer'], shortcut: { key: 86, modifiers: [16777248, 16777249, ] } }, 'Menu/Edit/Snap Vertices to Grid': { path: ['Edit', 'Snap Vertices to Grid'], shortcut: { key: 86, modifiers: [16777248, 16777251, 16777249, ] } }, 'Menu/Edit/Texture Lock': { path: ['Edit', 'Texture Lock'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Edit/UV Lock': { path: ['Edit', 'UV Lock'], shortcut: { key: 85, modifiers: [] } }, 'Menu/Edit/Replace Texture...': { path: ['Edit', 'Replace Texture...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/View/Grid/Show Grid': { path: ['View', 'Grid', 'Show Grid'], shortcut: { key: 48, modifiers: [] } }, 'Menu/View/Grid/Snap to Grid': { path: ['View', 'Grid', 'Snap to Grid'], shortcut: { key: 48, modifiers: [16777251, ] } }, 'Menu/View/Grid/Increase Grid Size': { path: ['View', 'Grid', 'Increase Grid Size'], shortcut: { key: 43, modifiers: [] } }, 'Menu/View/Grid/Decrease Grid Size': { path: ['View', 'Grid', 'Decrease Grid Size'], shortcut: { key: 45, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 0.125': { path: ['View', 'Grid', 'Set Grid Size 0.125'], shortcut: { key: 0, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 0.25': { path: ['View', 'Grid', 'Set Grid Size 0.25'], shortcut: { key: 0, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 0.5': { path: ['View', 'Grid', 'Set Grid Size 0.5'], shortcut: { key: 0, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 1': { path: ['View', 'Grid', 'Set Grid Size 1'], shortcut: { key: 49, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 2': { path: ['View', 'Grid', 'Set Grid Size 2'], shortcut: { key: 50, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 4': { path: ['View', 'Grid', 'Set Grid Size 4'], shortcut: { key: 51, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 8': { path: ['View', 'Grid', 'Set Grid Size 8'], shortcut: { key: 52, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 16': { path: ['View', 'Grid', 'Set Grid Size 16'], shortcut: { key: 53, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 32': { path: ['View', 'Grid', 'Set Grid Size 32'], shortcut: { key: 54, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 64': { path: ['View', 'Grid', 'Set Grid Size 64'], shortcut: { key: 55, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 128': { path: ['View', 'Grid', 'Set Grid Size 128'], shortcut: { key: 56, modifiers: [] } }, 'Menu/View/Grid/Set Grid Size 256': { path: ['View', 'Grid', 'Set Grid Size 256'], shortcut: { key: 57, modifiers: [] } }, 'Menu/View/Camera/Move to Next Point': { path: ['View', 'Camera', 'Move Camera to Next Point'], shortcut: { key: 46, modifiers: [] } }, 'Menu/View/Camera/Move to Previous Point': { path: ['View', 'Camera', 'Move Camera to Previous Point'], shortcut: { key: 44, modifiers: [] } }, 'Menu/View/Camera/Focus on Selection': { path: ['View', 'Camera', 'Focus Camera on Selection'], shortcut: { key: 85, modifiers: [16777249, ] } }, 'Menu/View/Camera/Move Camera to...': { path: ['View', 'Camera', 'Move Camera to...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/View/Isolate': { path: ['View', 'Isolate Selection'], shortcut: { key: 73, modifiers: [16777249, ] } }, 'Menu/View/Hide': { path: ['View', 'Hide Selection'], shortcut: { key: 73, modifiers: [16777251, 16777249, ] } }, 'Menu/View/Show All': { path: ['View', 'Show All'], shortcut: { key: 73, modifiers: [16777248, 16777249, ] } }, 'Menu/View/Switch to Map Inspector': { path: ['View', 'Show Map Inspector'], shortcut: { key: 49, modifiers: [16777249, ] } }, 'Menu/View/Switch to Entity Inspector': { path: ['View', 'Show Entity Inspector'], shortcut: { key: 50, modifiers: [16777249, ] } }, 'Menu/View/Switch to Face Inspector': { path: ['View', 'Show Face Inspector'], shortcut: { key: 51, modifiers: [16777249, ] } }, 'Menu/View/Toggle Toolbar': { path: ['View', 'Toggle Toolbar'], shortcut: { key: 84, modifiers: [16777251, 16777249, ] } }, 'Menu/View/Toggle Info Panel': { path: ['View', 'Toggle Info Panel'], shortcut: { key: 52, modifiers: [16777249, ] } }, 'Menu/View/Toggle Inspector': { path: ['View', 'Toggle Inspector'], shortcut: { key: 53, modifiers: [16777249, ] } }, 'Menu/View/Maximize Current View': { path: ['View', 'Maximize Current View'], shortcut: { key: 32, modifiers: [16777249, ] } }, 'Menu/File/Preferences...': { path: ['View', 'Preferences...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Run/Compile...': { path: ['Run', 'Compile Map...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Run/Launch...': { path: ['Run', 'Launch Engine...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Debug/Print Vertices': { path: ['Debug', 'Print Vertices to Console'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Debug/Create Brush...': { path: ['Debug', 'Create Brush...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Debug/Create Cube...': { path: ['Debug', 'Create Cube...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Debug/Clip Brush...': { path: ['Debug', 'Clip Brush...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Debug/Crash...': { path: ['Debug', 'Crash...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Debug/Throw Exception During Command': { path: ['Debug', 'Throw Exception During Command'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Debug/Show Crash Report Dialog': { path: ['Debug', 'Show Crash Report Dialog...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Debug/Set Window Size...': { path: ['Debug', 'Set Window Size...'], shortcut: { key: 0, modifiers: [] } }, 'Menu/Help/TrenchBroom Manual': { path: ['Help', 'TrenchBroom Manual'], shortcut: { key: 16777264, modifiers: [] } }, 'Menu/File/About TrenchBroom': { path: ['Help', 'About TrenchBroom'], shortcut: { key: 0, modifiers: [] } }, }; const actions = { 'Controls/Map view/Cancel': { key: 16777216, modifiers: [] }, 'Controls/Map view/Create brush': { key: 16777220, modifiers: [] }, 'Controls/Map view/Cycle map view': { key: 32, modifiers: [] }, 'Controls/Map view/Duplicate and move objects backward; Duplicate and move objects up': { key: 16777238, modifiers: [16777249, ] }, 'Controls/Map view/Duplicate and move objects down; Duplicate and move objects backward': { key: 16777237, modifiers: [16777249, ] }, 'Controls/Map view/Duplicate and move objects forward; Duplicate and move objects down': { key: 16777239, modifiers: [16777249, ] }, 'Controls/Map view/Duplicate and move objects left': { key: 16777234, modifiers: [16777249, ] }, 'Controls/Map view/Duplicate and move objects right': { key: 16777236, modifiers: [16777249, ] }, 'Controls/Map view/Duplicate and move objects up; Duplicate and move objects forward': { key: 16777235, modifiers: [16777249, ] }, 'Controls/Map view/Make structural': { key: 83, modifiers: [16777251, ] }, 'Controls/Map view/Move objects backward; Move objects up': { key: 16777238, modifiers: [] }, 'Controls/Map view/Move objects down; Move objects backward': { key: 16777237, modifiers: [] }, 'Controls/Map view/Move objects forward; Move objects down': { key: 16777239, modifiers: [] }, 'Controls/Map view/Move objects left': { key: 16777234, modifiers: [] }, 'Controls/Map view/Move objects right': { key: 16777236, modifiers: [] }, 'Controls/Map view/Move objects up; Move objects forward': { key: 16777235, modifiers: [] }, 'Controls/Map view/Move textures down': { key: 16777237, modifiers: [] }, 'Controls/Map view/Move textures left': { key: 16777234, modifiers: [] }, 'Controls/Map view/Move textures right': { key: 16777236, modifiers: [] }, 'Controls/Map view/Move textures up': { key: 16777235, modifiers: [] }, 'Controls/Map view/Perform clip': { key: 16777220, modifiers: [] }, 'Controls/Map view/Pitch objects clockwise': { key: 16777238, modifiers: [16777251, ] }, 'Controls/Map view/Pitch objects counter-clockwise': { key: 16777239, modifiers: [16777251, ] }, 'Controls/Map view/Reset camera zoom': { key: 16777216, modifiers: [16777248, ] }, 'Controls/Map view/Roll objects clockwise': { key: 16777235, modifiers: [16777251, ] }, 'Controls/Map view/Roll objects counter-clockwise': { key: 16777237, modifiers: [16777251, ] }, 'Controls/Map view/Rotate textures clockwise': { key: 16777238, modifiers: [] }, 'Controls/Map view/Rotate textures counter-clockwise': { key: 16777239, modifiers: [] }, 'Controls/Map view/Toggle clip side': { key: 16777220, modifiers: [16777249, ] }, 'Controls/Map view/View Filter > Hide entity links': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Hide faces': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Hide textures': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Shade faces': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Show all entity links': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Show directly selected entity links': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Show edges': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Show textures': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Show transitively selected entity links': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Toggle show brush entity bounds': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Toggle show brushes': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Toggle show entity classnames': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Toggle show group bounds': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Toggle show point entities': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Toggle show point entity bounds': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Toggle show point entity models': { key: 0, modifiers: [] }, 'Controls/Map view/View Filter > Use fog': { key: 0, modifiers: [] }, 'Controls/Map view/Yaw objects clockwise': { key: 16777234, modifiers: [16777251, ] }, 'Controls/Map view/Yaw objects counter-clockwise': { key: 16777236, modifiers: [16777251, ] }, };