ITextInputContext
Authoritative committed-document, selection, and geometry surface for native text input.
Remarks
Implementations(1)
Types that implement ITextInputContext.
public abstract int CopyCharRange(int charStart, int charLength, Span<char> destination)Copies committed chars [charStart, charStart + charLength) into destination, clamping to document bounds and destination capacity. Returns the number of chars actually written.
public abstract ValueTuple<int,int> GetCharSelection()Current selection normalised to (start, length); a collapsed caret reports (caret, 0).
public abstract bool TryGetCharRangeRect(int charStart, int charLength, out Rect rect)Screen rect of the range's portion on its first line (macOS firstRectForCharacterRange:, iOS firstRectForRange: — the OS aligns accent pickers, dictation highlights, and candidate windows to it). Returns false when no layout is available yet.
public abstract int HitTestChar(Vector2 screenPos)Char offset closest to a screen point, or -1 when no layout is available.
Text-unit navigation for the platform tokenizer (iOS UITextInputTokenizer and macOS equivalents). granularity: 0 = character (grapheme), 1 = word. direction: 0 = forward, 1 = backward. action: 0 = position toward boundary, 1 = is-at-boundary, 2 = enclosing-range start, 3 = enclosing-range end, 4 = is-within-unit. Returns a char offset for position queries, 0 / 1 for boolean queries, -1 when unsupported.
