Hello,
I wonder why android not allow to change characters according the developer need.
Actually, Android itself supports a fully customized keyboard, but you need to design the keyboard page completely yourself and connect it to Android through the InputMethodService.
However, this process is currently not available in MAUI, because the custom page cannot be called in the Resource class after the layout is created.
public class MyIMService : InputMethodService, View.IOnClickListener
{
private static String TAG = "MyIMService";
public override global::Android.Views.View? OnCreateInputView()
{
var myKeyboardView = LayoutInflater.Inflate(Resource.Layout.MyKeyboard, null); // Here you will get an error that the reference could not be found
Button btnA = myKeyboardView.FindViewById(Resource.Id.search_button) as Button;
btnA.SetOnClickListener(this);
//ADD ALL THE OTHER LISTENERS HERE FOR ALL THE KEYS
return myKeyboardView;
}
public void OnClick(View? v)
{
var ic = CurrentInputConnection;
if (v is Button) {
String clickedKeyText = ((Button)v).Text.ToString();
ic.CommitText(clickedKeyText, 1);
}
}
}
Therefore, in the current MAUI, an alternative solution is through a pop-up window with Entry, the layout under the Entry that you could set up as a keyboard-style grid view, and add content to the Entry via a click event.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.