monogame-ui-textbox

Installation
SKILL.md

MonoGame UI TextBox

Text input controls for MonoGame. Four variants share a common base: TextBoxBase. Each handles Window.TextInput (for correct Unicode / IME support) and maintains a cursor position. For complete code, read references/ui-textbox.md.

Assumed Contract

Extends UIElement from monogame-ui-core. Requires focus from monogame-ui-focus — keyboard events route here only when UIFocusManager.FocusedElement == this. Uses Window.TextInput event, not keyboard polling.

The TextInput Event (Not Polling)

Never poll character keys manually. Keyboard.GetState() gives you key codes, not characters — it cannot handle Unicode, IME composition, keyboard layout differences, or modifier combos correctly. Use the platform event instead:

// In Game.Initialize():
Window.TextInput += OnTextInput;
Installs
14
GitHub Stars
2
First Seen
May 20, 2026
monogame-ui-textbox — alca259/monogame-skills