Treating keyboard input as different characters

Godot Version

v4.7.stable.official

Question

I’ve started making a 10-finger typing learning game but for Thai language. So any keyboard input I make on my UK QWERTY keyboard needs to be interpreted by the game as the corresponding Thai letter.

The main function of the game will be to read what key the player presses, compare it to a rich-text field containing Thai characters, in game to check if the input was correct and then proceed to the next letter to ‘kill enemies’ by correctly typing the word. For example if I press “a” on my keyboard I need the game to act like I’ve entered “ฟ” and validate this letter, then move onto the next. Like this I want to map the whole keyboard for both lower and uppercase letters.

I’m sure there’s a way I just don’t know where to start looking. If anyone has any ideas please send help :folded_hands: (I’m a complete beginner so please bear with me)

I dont know much about thai, but if letters are 1 to 1, would set up a dictionary and make it translate latin keyboard inputs to thai characters. But perhaps some combinations are like “kh” = a separate thai character? That would make it a lot trickyer. Same with upper lower case. I googled it and it seems like there are no different symbols for upper/lower case in thai.

Then just

var dict: Dictionary = {

A = ฟ,

Etc

}

And make characters .to_upper() when you add them to the dictionary. Then both “a” and “A” will get translated into the same.

I would use localization.

Thank you so much! I will try that :heart:

Sure! If any questions pop up, just share them here and I’ll try to help out!