Added in @Jipok's comment.

This commit is contained in:
Adam Harrison 2021-12-18 15:09:00 -05:00 committed by Guldoman
parent c7f5e92bb8
commit d237ff9c15
No known key found for this signature in database
GPG Key ID: C08A498EC7F1AFDD
1 changed files with 5 additions and 0 deletions

View File

@ -104,6 +104,11 @@ static const char *get_key_name(const SDL_Event *e, char *buf) {
!(e->key.keysym.mod & KMOD_NUM)) {
return numpad[scancode - SDL_SCANCODE_KP_1];
} else {
/* We need to correctly handle non-standard layouts such as dvorak.
Therefore, if a Latin letter(code<128) is pressed in the current layout,
then we transmit it as it is. But we also need to support shortcuts in
other languages, so for non-Latin characters we pass the scancode that
matches the letter in the QWERTY layout. */
if (e->key.keysym.sym <= 128)
strcpy(buf, SDL_GetKeyName(e->key.keysym.sym));
else