Fixed key names for Thai keyboards
Using the shifted versions of keys for the key names doesn't make any sense on the Thai keyboard. Thai keyboards are QWERTY plus Thai characters, so let's use the ASCII key names.
This commit is contained in:
1 parent
b7aca89466
commit
eac8e858d5
1 file changed
+5
@@ -1015,6 +1015,11 @@ const char *SDL_GetKeyName(SDL_Keycode key)
|
||||
} else if (key > 0x7F) {
|
||||
SDL_Scancode scancode = SDL_GetScancodeFromKey(key, SDL_KMOD_NONE);
|
||||
if (scancode != SDL_SCANCODE_UNKNOWN) {
|
||||
if (key >= 0x0E00 && key <= 0x0E7F) {
|
||||
// Thai keyboards are QWERTY plus Thai characters, so let's use the ASCII key names
|
||||
return SDL_GetScancodeName(scancode);
|
||||
}
|
||||
|
||||
SDL_Keycode capital = SDL_GetKeyFromScancode(scancode, SDL_KMOD_SHIFT);
|
||||
if (capital > 0x7F || (capital >= 'A' && capital <= 'Z')) {
|
||||
key = capital;
|
||||
|
||||
Reference in new issue
Block a user