fixed numpad not working with layout emulator

closes #2755
This commit is contained in:
Miodec 2022-03-25 14:00:19 +01:00
parent d7ff5f0f74
commit 623e280aa5

View file

@ -187,7 +187,13 @@ export async function getCharFromEvent(
mapIndex = i;
}
}
if (!mapIndex) return null;
if (!mapIndex) {
if (event.code.includes("Numpad")) {
return event.key;
} else {
return null;
}
}
const newKeyPreview = layoutMap[mapIndex][0];
const shift = emulatedLayoutShouldShiftKey(event, newKeyPreview) ? 1 : 0;
const char = layoutMap[mapIndex][shift];