For text input there is the well-named GameWindow.TextInput event.
You can add delegates to it from your Game1 implementation with code like the following:
// in Game1.Initialize
Window.TextInput += TextInputHandler;
private void TextInputHandler(object sender, TextInputEventArgs args)
{
var pressedKey = args.Key;
var character = args.Character;
// do something with the character (and optionally the key)
// ...
}
Hello, Welcome to the forums, don’t worry about your English, you can also optionally write a simple explanation in English and depending on your first language, you can explain it in that too so others who speak the same language can also help and some of us can translate it to try to help too, so, don’t worry about a language barrier, but try to always include English in your help request to ensure more people can help faster.
Oh my… I have been working with MonoGame for almost two years and didn’t realize this was there! I cant tell you how much time this saves me… wow. Thank you so much! (a little embarrassed)
(by the way) On the topic of language input… does anyone have suggestions on how to handle input for Japanese or Chinese?
I’ve tried setting keys so that Alt, Shift, etc can be used to change character, but someone told me many people have roman-character keyboards and “IME”(?) handles changing sounds to characters. If that’s the case, then maybe I should have 2 options?
Any experience or ideas about this?