This is a common problem. The problem is that XNA is not designed to enter text input from the keyboard. It is designed to obtain the current status of each key on the keyboard.
For now, you can write your own code to check things like shift wrapping, etc., for keys that you don't use (e.g., another language, different format). What most people do is get windows to do this for you.
If you want the text to appear as expected, you basically need to recreate a few things and get windows to do it for you.
See the Promit post here: http://www.gamedev.net/topic/457783-xna-getting-text-from-keyboard/
Using:
Add your code to your solution. Call EventInput.Initialize in your game's Initialize` method and subscribe to its event:
EventInput.CharEntered += HandleCharEntered; public void HandleCharEntered(object sender, CharacterEventArgs e) { var charEntered = e.Character;
Note. If you allow you to enter any character (for example, foreign ones using umlauts, etc.), make sure that your SpriteFont supports them! (If not, maybe just check if your font supports it before adding it to a text string or getting spritefont to use a special "invalid" character).
source share