src/vs/base/browser/keyboardEvent.ts/extractKeyCode
function extractKeyCode(e: KeyboardEvent): KeyCode {
	if (e.charCode) {
		// "keypress" events mostly
		const char = String.fromCharCode(e.charCode).toUpperCase();
		return KeyCodeUtils.fromString(char);
	}

	const keyCode = e.keyCode;

	// browser quirks
	if (keyCode === 3) {
		return KeyCode.PauseBreak;
	} else if (browser.isFirefox) {
		if (keyCode === 59) {
			return KeyCode.Semicolon;
		} else if (keyCode === 107) {
			return KeyCode.Equal;
		} else if (keyCode === 109) {
			return KeyCode.Minus;
		} else if (platform.isMacintosh && keyCode === 224) {
			return KeyCode.Meta;
		}
	} else if (browser.isWebKit) {
		if (keyCode === 91) {
			return KeyCode.Meta;
		} else if (platform.isMacintosh && keyCode === 93) {
			// the two meta keys in the Mac have different key codes (91 and 93)
			return KeyCode.Meta;
		} else if (!platform.isMacintosh && keyCode === 92) {
			return KeyCode.Meta;
		}
	}

	// cross browser keycodes:
	return EVENT_KEY_CODE_MAP[keyCode] || KeyCode.Unknown;
}