Skip to content

How can I implement Text input components? #15152

Answered by maxkatz6
kyuranger asked this question in Q&A
Discussion options

You must be logged in to vote

You are looking at wrong interfaces. These two are internal implementation details, that are provided by the platform backends (ios, android...). You can't implement these.

If you develop a custom TextBox-like control, you need to use TextBoxTextInputMethodClient:
https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Controls/TextBox.cs#L342-L348
https://github.com/AvaloniaUI/AvaloniaEdit/blob/adbe72b8023207270d30c16beb4fadcd6d598023/src/AvaloniaEdit/Editing/TextArea.cs#L71-L77

But since you develop a custom keyboard, while keeping default input controls, you likely don't need that. Just send events to the focused control.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@kyuranger
Comment options

@maxkatz6
Comment options

@kyuranger
Comment options

Answer selected by kyuranger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants