what to draw for a password field: every character replaced by the mask
the backspace key: removes the selection, or the character before the caret
the delete key: removes the selection, or the character after the caret
inserts at the caret, replacing the selection, as a keystroke from onText does
arrow keys: moves the caret, extending the selection when the shift key is held
replaces the selection (or inserts at the caret) and leaves the caret after the new text
replaces everything; the caret goes to the end and a new string is never longer than maxLength
The editing state behind a text field, with no renderer attached - the counterpart to
core.Input'sonText, which supplies the characters: the DOM gives a key, this decides where it goes, and a game drawsvalue(ormaskedValue) with the caret it reports.The caret is an index into
value; a selection is the caret plus an anchor, so every edit replaces the selection when there is one and inserts at the caret when there is not, which is the behaviour a plain<input>has and a title screen's name entry expects.Example