Vixen
dd8b0a81

ITextInputTarget

interface Core/Vixen.Ui/TextInputTarget.cs:26
csharp
public interface ITextInputTarget

A focusable element that wants keystrokes to go through the operating system's input method.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The framework half of ITextInput, which Vixen.Ui is not allowed to name. Vixen.Platform sits above the Core/ assemblies, so a control cannot call Activate or SetCandidateArea itself. What it can do is answer two questions about itself, and let the host — Vixen.Platform.Ui's PlatformTextInput — ask them once a frame. The same shape as Cursor and PlatformCursor, for the same layering reason.

⚠ Implementing this is what turns text input on, and nothing else does. Text input is off by default on every platform — while it is on, the platform gives keystrokes to the IME first, so W may compose instead of moving a character. Desktop appears to work without any of this only because SDL leaves text input running; a focused field on web or on a phone receives nothing at all until somebody activates it.

Fields and properties (2)

  • bool AcceptsTextInput

    Whether this element would accept typed text right now.

  • Rectangle CaretArea

    Where the caret is, in the document's absolute coordinate space, in logical points.

Used by (4)

  • CodeEditorVixen.Ui.Controls.Advanced
  • CommandDispatcherVixen.Ui.Controls
  • PlatformTextInputVixen.Platform.Ui
  • TextFieldVixen.Ui.Controls