mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-20 22:35:41 +00:00
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:
@@ -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