Back to API Reference
Interface
ITextInputContext
abstract
Authoritative committed-document, selection, and geometry surface for native text input.
Remarks
Offsets use UTF-16 code units, coordinates use Unity screen pixels, and calls use the reporter epoch's creating thread.
Implementations(1)
Types that implement ITextInputContext.
public abstract ValueTuple<int,int> GetCharSelection()Current selection normalised to (start, length); a collapsed caret reports (caret, 0).
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.
