Not a query here, I just want to express my exasperation that when I first started using MonoGame/XNA, none of the tutorials pointed me towards polling keyboard text input via the Game.Window.TextInput event.
If you search for “MonoGame/XNA Keyboard Input” you will find dozens of solutions where people are relying on KeyboardStates and setting up dictionary lookups from the Keys enum to respective chars and conditional logic to allow their users to write text into their game window while accounting for things like shift presses, backspace etc., which were still imperfect because I’m fairly sure that doesn’t account for regional keyboards (not all keyboards represent “+” with “Shift+=”, I think).
I was doing the same thing, until I came across a few mentions of this event, and the e.Character argument will return a char, accounting for shift presses, capslock, and even hold-down multipress with only a single line of code?! Why don’t more tutorials include this functionality! Judging by my google results, hundreds of people are building homebrew solutions for something that is apparently already built-in.
Anyway, no real conclusion here, I guess I just wanted to raise awareness that this feature exists. Maybe this is something people are more aware of if they’d previously worked with Windows Forms, because I believe this is based off of functionality that exists there?