-
Recently I am working hard on virtual keyboard in Avalonia Linux DRM. Although I do it via some simple events like:
But I don’t implement it through Avalonia’s official interface(https://github.com/AvaloniaUI/Avalonia/wiki/IME). I hope my input method can still follow the official interface of Avalonia. However, I don’t understand how to use Avalonia’s official interface at all, and there are no examples or tutorials. And I checked some related source codes and found that some interfaces were marked as Unstable, and I was even more unclear about how to use them. Please tell me how to implement it according to the Avalonia official interface (it is best to have relevant examples or tutorials). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
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: 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. |
Beta Was this translation helpful? Give feedback.
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.