Restore default behavior for keypad keycodes

Added a hint to translate numpad keycodes into their non-numpad versions based on the NumLock state
This commit is contained in:
Sam Lantinga
2024-07-02 18:13:25 -07:00
parent bafd04ecdb
commit ed9bbb2dca
5 changed files with 162 additions and 101 deletions

View File

@@ -502,7 +502,7 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent
}
}
if (SDL_utf8strlen(keyEvent->key) == 1) {
if (keyEvent->location == 0 && SDL_utf8strlen(keyEvent->key) == 1) {
const char *key = keyEvent->key;
keycode = SDL_StepUTF8(&key, NULL);
if (keycode == SDL_INVALID_UNICODE_CODEPOINT) {