From b4384eb49d8a57eaded6989eb795e8098a323a52 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sat, 18 Dec 2021 15:09:00 -0500 Subject: [PATCH] Added in @Jipok's comment. --- src/api/system.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api/system.c b/src/api/system.c index b2438589..cff28ace 100644 --- a/src/api/system.c +++ b/src/api/system.c @@ -106,6 +106,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