import { KeyboardEventCodes as Codes } from './KeyboardEventCodes.js';
import { KeyboardMapKeys } from './KeyboardMapKeys.js';
export function extractCode(e) {
    var event = e.nativeEvent || e;
    if (event.code) {
        return event.code;
    }
    var keyCode = event.keyCode || event.which;
    var location = event.location;
    var mapped = Object.entries(KeyboardMapKeys).find(function (_a) {
        var set = _a[1];
        return set.some(function (_a) {
            var _keyCode = _a[0], _location = _a[1];
            return _keyCode === keyCode && _location === location;
        });
    });
    return mapped ? mapped[0] : Codes.Unidentified;
}
//# sourceMappingURL=extractCode.js.map